@@ -8,7 +8,7 @@ Makefile
Makefile.old
blib/
cover_db/
-t/
+t/e2e/
lib/Devel/Cover/Inc.pm
pm_to_blib
*.out
@@ -18,3 +18,4 @@ pm_to_blib
*.orig
*.rej
tmp/
+MYMETA.yml
@@ -1,23 +0,0 @@
-- BEGIN and CHECK blocks and code in modules is not reported.
-
-- Doesn't play nicely with all of Perl's testsuite.
-
-- elsif and else coverage is reported on the same line as the if
- statement. This is because perl doesn't store the line number for the
- elsif and elses. For the same reason the following warning is
- reported on line 1 rather than line 2:
-
- perl -we 'if ($a) {}
- elsif ($a + 1) {}'
- Use of uninitialized value in addition (+) at -e line 1.
-
-- Pod coverage only reports data for modules, not top level scripts.
- This is a limitation in Pod::Coverage.
-
-- Pod coverage does not work well with source filters including Switch.
- Line numbers are reported incorrectly.
-
-- If an END block installs another END block it won't be covered. More
- generally, any code run after Devel::Cover's END block won't be covered.
-
-- Empty subs will be ignored in Perl 5.8.1.
@@ -1,514 +0,0 @@
-Devel::Cover.pm history
-
-Release 0.68 - 5th August 2010
- - Fix gcov2perl to work with large numbers (Thomas Dorner) (rt 45028).
- - Fix "gcov -l" include files (Thomas Dorner) (rt 44864).
- - Test against 5.12.1.
- - Gross workaround for for regexp evals (Florian Ragwitz).
-
-Release 0.67 - 8th May 2010
- - Fix up the Makefile for dmake on Strawberry Perl (Curtis Jewell) (rt 50774).
-
-Release 0.66 - 12th April 2010
- - Move to faster method of collecting data. Could be up to twice as fast now.
- - Add -replace_ops options to be able to revert to previous collection method.
- - Test against 5.12.0 and update tests as necessary.
- - Work better with non-existent databases.
- - XS fixes related to overriding ops rather than replacing runops
- (Florian Ragwitz).
- - Don't chmod created directories (mkdir should suffice).
-
-Release 0.65 - 8th August 2009
- - Fix uninitialised value warning (reported by Andrew Billeb).
- - Test against 5.8.9 and 5.10.1 (RC1).
- - Correct deparsed conditional output in elsif conditions.
- - Unset PERL5OPT when running tests.
-
-Release 0.64 - 10th April 2008
- - Build on Windows.
- - Make "cover -test" work for Module::Build (Michael G Schwern) (rt 34263).
- - Make "cover -test" cover .[ch] files (Michael G Schwern) (rt 34262).
- - Make "cover -gcov" a valid option (Michael G Schwern) (rt 34261).
-
-Release 0.63 - 16th November 2007
- - require 5.006001 might stop CPAN testers trying to test with 5.005.
- - store_return() should be a void function (H.Merijn Brand).
- - Finish dor support.
- - Add support for exec (Brandon Black).
- - Tested against 5.10 (RC1).
-
-Release 0.62 - 5th November 2007
- - Add table sorting to Html_basic report (Nathan Haigh).
- - Assume heredocs are constants.
- - Don't add 0x200 to $^P ("file" names for evals) (Fix for Template::Declare).
- - Add timer and alarm for cpancover.
- - Add Report Date to basic html report.
- - Quieten some warnings.
- - Document cover -test.
- - Get rid of any __DIE__and __WARN__ signals during the report.
- - Don't try to get a digest for "-e".
- - Tidy up filename normalisation.
- - Be more explicit about what I mean when I call this alpha software.
- - Add uncoverable comments.
- - Don't complain about POSIX.pm (Erwan Lemonnier).
- - Don't resolve pathnames of symbolic links (Stefan Becker).
- - Spelling nits (James E Keenen).
-
-Release 0.61 - 10th January 2007
- - Fix some "ignored" errors due to multiple subs of the same name on the same
- line (rt 14192).
- - Display pod coverage with subroutine coverage in text report.
- - Update golden output (tests were failing in 0.60).
-
-Release 0.60 - 2nd January 2007
- - Simplify get_key function and remove TODO item (Gisle Aas).
- - Be careful with UNC paths on Windows (John LoVerso) (rt 24105).
- - Only call HvSHAREKEYS_off if threading is enabled.
- - s/unvailable/unavailable/ (Jim Cromie).
- - Don't key on op_targ - it might change (rt 22701).
- - Tidy up docs and error messages for reports (rt 21098).
- - Better database validation.
- - Don't delete invalid datbases (rt 16039).
- - Tested against 5.9.5.
- - Allow for new anonlist and anonhash ops (rt 24067).
- - Use outputfile for both cover and cpancover.
- - Add compilation report (Denis Howe).
-
-Release 0.59 - 23rd August 2006
- - Tidy up HTML, especially for cpancover.
- - Allow coverage of subroutine statements in a different file (as with Mason)
- (clkao).
- - Bump refcount on subs to ensure they stay around for us to look at them
- (yes, this is a hack).
-
-Release 0.58 - 6th August 2006
- - Be more clever about void context and so avoid SvROK hack.
- - Document some bugs, limitations and requirements.
- - HTML alignment fix (Sébastien Aperghis-Tramoni).
- - CSS improvements for HTML reports (Sébastien Aperghis-Tramoni).
-
-Release 0.57 - 3rd August 2006
- - Report Pod::Coverage load failure (dom - happygiraffe.net) (rt 14425).
- - Use Perl::Tidy as an alternative syntax highlighter
- (Sébastien Aperghis-Tramoni).
- - Lighten the style a little - make table cells only have right and bottom
- borders, using the ones from the surrounding cells to form the grid
- (Sébastien Aperghis-Tramoni).
- - subs_only option to only show coverage for subs (Nicholas Clark).
-
-Release 0.56 - 1st August 2006
- - gcov2perl creates db if necessary (Steve Peters) (rt 13536).
- - Properly merge identical files (Jeff Wren) (rt 12410).
- - Allow line achors in html_basic (Mark Stosberg) (rt 13615).
- - Right justify numerical tabular html output (Sébastien Aperghis-Tramoni).
- - Work around ExtUtils::MakeMaker realclean bug (Florian Ragwitz) (rt 17324).
- - Don't try to delete db if it isn't there.
- - The following changes were made at the Devel::Cover hackathon, sponsored by
- Best Practical.
- - No longer create the temporary .version files (Leon Brocard).
- - Document Module::Build's testcover (Leon Brocard).
- - Add more detail about code coverage in docs (Leon Brocard).
- - Make the HTML valid by moving comment past the <?xml> (Leon Brocard).
- - Add syntax highlighting to HTML_basic if PPI::HTML is installed
- (Leon Brocard).
- - Refactored common code for calculate_summary across all Criterion classes
- (Norman Nunley).
- - Remove duplicated code paths between Branch and Condition (Norman Nunley).
- - Don't call overload bool in condition coverage (clkao).
- - Fix the XML comment for cpancover (Norman Nunley).
- - Turn conditionals in void context into or2 conditions so that the value of
- the RHS doesn't matter for coverage purposes.
- - Add a tool to scan comments about uncoverable code and output .uncoverable
- format to stdout (clkao).
- - Add and update overload tests.
-
-Release 0.55 - 22nd September 2005
- - Add -gcov option to cover and make it default when using gcc.
- - Remolve unused File::Find from cpancover.
- - Document how to get XS coverage in gcov2perl.
- - Improvements to SVK annotation (Chia-liang Kao).
-
-Release 0.54 - 13th September 2005
- - Make html_basic prettier.
- - Fix pod coverage percentages.
- - Fix integer <-> pointer conversion warnings (Robin Barker).
- - Add more tests for sort bug fixed in 0.53 (Rob Kinyon).
- - Handle || bless {}, "XXX" (reported by Marcel Grünauer).
- - Add preliminary dor support (unfinished).
- - Test against perl-5.8.7.
- - Add check for Pod::Coverage::CountParents.
- - Fix line number display problem in conditionals in Html_basic.
- - Add eval_sub and eval3 tests.
- - Add buildperl script.
- - Add -report option to cpancover.
- - Update cpancover CSS.
- - Partial solution for structure problems including debugging code.
- - Add outputfile option to Html_basic.
-
-Release 0.53 - 17th April 2005
- - Clean up database directories.
- - Allow require File::Spec->catfile('t', 'common.pl'); (from an example by
- Randy W. Sims).
- - Fix core dump associated with sort subs and add test case supplied by
- Leif Eriksen.
- - Add extra options for coverage criteria.
- - Allow pod coverage options to be specified.
- - Update copyrights.
- - Allow Test::Differences output to be displayed usefully.
- - Test against perl-5.9.3.
-
-Release 0.52 - 13th December 2004
- - Fix thread locking bug (Ruslan Zakirov).
- - Make valgrind happy.
- - Fix gcov2perl (Steve Peters).
- - Restore failure message to CLONE.
-
-Release 0.51 - 29th November 2004
- - Handle $y || undef.
- - Small branch coverage fix.
- - Improve reporting of uncoverable constructs in html reports.
- - Test against perl-5.8.6.
- - Recommend at least perl-5.8.2.
-
-Release 0.50 - 25th October 2004
- - Add -test option to cover.
- - Fix missing coverage when calling a sub in an ignored module.
- - Add module_ignore test.
- - Add uncoverable options to cover.
-
-Release 0.49 - 6th October 2004
- - Compile on Win32 (and elsewhere) (Steve Hay).
-
-Release 0.48 - 5th October 2004
- - Working towards thread safety.
- - Test against perl-5.8.5.
- - Store perl version number in Inc.pm and complain if it doesn't match.
- - Add annotation API and Random example.
- - Display run information in text report.
- - Remove POSIX path bodge which is now properly fixed.
- - Update test results for new functionality.
- - Add -select_re and -ignore_re options to cover.
- - Sort out "ignoring extra subroutine" and friends.
- - Add eval2 and eval_use tests.
- - Ignore *.t by default with blib.
- - Add beginnings of sort report.
- - Bump up DB version.
- - Fix problems with references in INC (which can't be handled).
- - Fixes for mod_perl (Vadim O. Ustiansky).
-
-Release 0.47 - 27th June 2004
- - Provide subroutine coverage for empty subs - sub empty { }.
- - Only override B::Deparse subs whilst using them and add deparse test.
-
-Release 0.46 - 23rd June 2004
- - Don't lose data merging DBs.
- - Work with Safe.pm, by not covering it.
- - Swap Profiling_op for Profiling_key to avoid accessing freed memory.
- - Rename -file and -exclude options in cover to -select and -ignore.
- - Fully cover conditions and branches when the condition calls a sub in
- an ignored file.
-
-Release 0.45 - 27th May 2004
- - Cope with spaces in build path on Windows (Max Maischein).
- - Allow Devel::Cover to be used under mod_perl (Philippe M. Chiasson).
- - Handle $x ||= 1 and friends nicely, including subs and *foo{THING}.
- - Allow uncoverable code to be specified. (Unfinished)
-
-Release 0.44 - 18th May 2004
- - Fix get_elapsed, although its result is not used yet.
- - Recommend 5.8.1 as a minimum.
- - Replace run Makefile target with text and html.
- - Fix up gcov2perl.
- - Fail gracefully when covering a threaded program.
- - Add DEVEL_COVER_OPTIONS environment variable.
-
-Release 0.43 - 2nd May 2004
- - Add +ignore and +select options, and change meaning of -ignore and
- -select options. This is an interface change.
- - Ignore coverage on Devel::Cover's files by default.
- - Cover INIT and END blocks more reliably.
- - Fix 5.6 on Windows. Well, sort of.
- - Add a message in Makefile.PL recommending against using Devel::Cover
- on 5.6, especially under Windows.
-
-Release 0.42 - 30th April 2004
- - Add SYNOPSIS section to README.
- - Resolve links for Devel::Cover::Inc (Dave Rolsky).
- - Get things running on Windows again.
-
-Release 0.41 - 29th April 2004
- - Correct time coverage percentages.
- - Collect data for BEGIN, CHECK, INIT and END blocks in the main
- program, and INIT and END blocks in modules.
- - Ensure our END block is always the last run.
- - Don't clean up Pending_conditionals data.
- - Untaint @INC after using blib.
- - Be silent if called via HARNESS_PERL_SWITCHES.
- - Test against perl-5.8.4.
- - Store cwd from when each module was required in order to find them again.
- - Refactor and tidy XS code.
- - Get cpancover running again with the DB changes.
- - Normalise filenames.
-
-Release 0.40 - 24th March 2004
- - Remove DB structure for unwanted files.
- - Identify ops based on address and OP contents, except for op_ppaddr,
- which we modify.
- - Overhaul of coverage collection.
- - Additions to tests.
-
-Release 0.39 - 22nd March 2004
- - Major database rework to store runs.
- - Add Devel::Cover::DB::Structure.pm.
- - Check for Test::Differences in Makefile.PL.
- - Test with perl5.9.2.
- - Skip fork test on MSWin32.
-
-Release 0.38 - 12th March 2004
- - Allow coverage summary title to be changed (David Wheeler).
- - More care generating pod golden results.
- - Small Devel::Cover::Op output fix.
- - Handle "my $x = shift || []" and friends nicely.
- - Add default_param test.
- - Provide summary output to one decimal place.
- - Update gcov2perl.
-
-Release 0.37 - 10th March 2004
- - Fix up pod test golden results.
- - Add limitation documentation (Michael Carman).
-
-Release 0.36 - 9th March 2004
- - Add fork test.
- - Remove debugging code from md5 test.
- - Remove runs after merging - code was commented out for debugging.
- - Don't merge runs during coverage collection.
- - Delete database at start if not merging to cope with forking.
-
-Release 0.35 - 8th March 2004
- - Change Text2 to pick up version changes.
- - Minor documentation updates.
- - Minor changes to Devel::Cover::Op.
- - Add outputfile option to HTML output (David Wheeler).
- - Document -silent option to Devel::Cover.
- - Add -silent option to cover (David Wheeler).
- - Make Devel::Cover taint safe, or tolerant at least.
- - Only add versioned golden results to tests that need them.
- - Add trivial, md5 and module_no_inc tests.
- - Increase flexibility of testing system to accomodate md5 test.
- - Add mani, all_gold and all_test Makefile targets.
- - Make all_versions skip non-existent platforms.
- - Add DB option to make dump target.
- - Remove dependencies on op_seq. (I removed it from bleadperl.) Use
- op_targ instead.
- - Collect some metadata.
- - Documentation updates (Andy Lester).
- - Document the mechanism by which files are selected for coverage.
-
-Release 0.34 - 14th January 2004
- - Fix various warnings and errors that had crept in whilst working on
- dynamic subs.
-
-Release 0.33 - 13th January 2004
- - Get things working on paths with spaces in them.
- - Documentation clarifications (Andy Lester).
- - Fix coverage for simple if, elsif and unless conditionals.
- - Add if test.
- - Ensure runs are merged in the order they were created.
- - Don't report multiple data from dynamically created subs.
- - Add alias, alias1 and dynamic_subs tests.
- - Fix and document Devel::Cover::Op.
- - Redo subroutine coverage so anon subs are covered correctly in 5.6.x.
-
-Release 0.32 - 4th January 2004
- - Actually include do test.
- - Create run concept in database.
- - Belatedly remove check for Template.
- - Add branch_return_sub test.
- - Add finalise_conditions() to collect previously missed coverage.
- - Fix incorrect coverage results associated with "and" conditions.
- - Add all_versions utility script.
- - Put /usr/bin/perl on all shebang lines.
-
-Release 0.31 - 22nd December 2003
- - Remove debugging output. Hmmm.
-
-Release 0.30 - 22nd December 2003
- - Get things working under Windows.
-
-Release 0.29 - 19th December 2003
- - Merge data from files with identical MD5 checksums (Arthur Bergman).
- - Add do test.
- - Handle $x || return.
- - Keep cover -delete happy when there is no existing database.
- - In cover, make -file a glob and add -exclude.
- - Watch for coverage options being set in cover (PERL5OPT set?).
- - Fix up html_basic and html_subtle.
- - Make 5.6.x builds a bit quieter.
- - Clean up time routines in XS code.
-
-Release 0.28 - 1st December 2003
- - Remove leading whitespace from HTML templates (Gabor Szabo).
- - Remove obsolete indent option.
- - Add MD5 checksums (Michael Carman).
- - Add Html_minimal.pm (Michael Carman) (Obsoleting Gabor's patch before it was
- released).
- - Pass unknown cover options to the formatter and remove -option.
- - Specify the output directory for HTML.
- - Search up directory trees for modules.
-
-Release 0.27 - 9th November 2003
- - Behave sensibly if import() is not called, for example when MakeMaker does a
- PREREQ_PM check.
- - Use Storable for the database instead of Data::Dumper/eval (Michael Carman).
-
-Release 0.26 - 12th October 2003
- - Decline to output HTML results for conditions containing > 16 terms.
- - Add titles to HTML output.
-
-Release 0.25 - 10th October 2003
- - Fix for perl 5.6.1. Cwd::abs_path($d) gets upset if $d doesn't exist.
- - Start of some changes to cpancover HTML.
-
-Release 0.24 - 10th October 2003
- - Paths in Devel::Cover::Inc in single quotes for Windows platforms.
- - Add -dir option and default it to cwd.
- - Ignore test.pl in cpancover.
- - Display pod coverage in cpancover.
-
-Release 0.23 - 6th September 2003
- - Report condition coverage for branches on the same line as the branch.
- - Add subroutine coverage.
- - Made "all" coverage value work and made it the default.
-
-Release 0.22 - 2nd September 2003
- - Rewrite runops function.
- - First line of DESTROY blocks and overload subs not now skipped.
- - Add some more tests.
-
-Release 0.21 - 1st September 2003
- - Add cpancover.
- - Handle $x || next and friends.
- - Add html_subtle and text2 backends (Michael Carman).
- - Rename html backend to html_basic.
- - Make html backend a wrapper around preferred style, currently html_subtle.
- - Make time coverage a little more accurate. OK, a lot more accurate, it's at
- least on the right line now, but I still wouldn't really trust it.
- - Fix pod coverage which has been broken for a while.
- - Don't collect branch coverage when not asked for.
- - Provide golden results for different Perl versions.
- - Change some B::Deparse logic to mirror changes in 5.8.1/5.10.
-
-Release 0.20 - 5th October 2002
- - Add break after default to satisfy IBM's xlC compiler on AIX.
- - Get things working with threads again.
- - make realclean is.
-
-Release 0.19 - 29th September 2002
- - Quieten uninitialised value warnings.
-
-Release 0.18 - 28th September 2002
- - Redo the way condition coverage is gathered - abuse op_ppaddr.
- - Put or conditions the right way round.
- - Allow for subclasses of coverage types.
- - Add:
- Devel::Cover::Condition_or_2.pm
- Devel::Cover::Condition_or_3.pm
- Devel::Cover::Condition_and_3.pm
- Devel::Cover::Condition_xor_4.pm
- - "use" all conditions in Criterion.pm, and nowhere else.
- - Add support for xor, ||= and &&=.
-
-Release 0.17 - 15th September 2002
- - Call check_files() in report() to ensure we pick up anything added to the
- symbol table while the program was running.
-
-Release 0.16 - 9th September 2002
- - Get rid of some uninitialised warnings.
- - Inline the HTML templates.
- - Rebless the op after blessing it as a COP.
- - Make branch coverage line numbers more accurate.
-
-Release 0.15 - 5th September 2002
- - Reinstate coverage of subs in main:: which got lost somewhere (0.11?).
- - Bug fixes for use of uninitialised values.
- - Automatically generate tests. Well, their infrastructure anyway.
- - Move Cover to lib/Devel/Cover to keep case insensitive filesystems happy.
- - Remove -detail option. (It belongs to cover.)
- - Work on op addresses and sequence numbers instead of just op addresses, to be
- (almost) unique.
- - Clean up subroutine location code.
- - Fix -select to override anything else.
- - Add condition coverage for && and || ops.
- - Various changes in runops_cover to try to reduce runtime.
- - Don't use runops_cover until CHECK time.
- - Add merge, write and file options to cover.
- - Add branch coverage.
- - Abstract away cover backends.
- - Use TT for HTML output.
-
-Release 0.14 - 28th February 2002
- - Add a workaround for an AUTOLOAD bug in bleadperl.
- - Add gcov2perl program to convert gcov files to Devel::Cover databases.
- - Get rid of // comments in xs file.
-
-Release 0.13 - 14th October 2001
- - Forgot to allow for lack of Pod::Coverage in Devel::Cover::Pod.pm.
-
-Release 0.12 - 14th October 2001
- - Improve pod coverage by considering private subs.
- - Add time coverage, aka profiling.
- - Add:
- Devel::Cover::DB::File.pm
- Devel::Cover::Time.pm
- - Abstract summary and percentage calculations to appropriate classes.
-
-Release 0.11 - 10th September 2001
- - Add pod coverage based on Pod::Coverage.pm.
- - Put a full API on the database.
- - Add:
- Devel::Cover::Criterion.pm
- Devel::Cover::Statement.pm
- Devel::Cover::Condition.pm
- Devel::Cover::Pod.pm
- - Some improvements to the cover program.
-
-Release 0.10 - 27th August 2001
- - Add cover program to generate reports.
-
-Release 0.09 - 18th August 2001
- - Beef up Devel::Cover::DB.
-
-Release 0.08 - 18th August 2001
- - Provide better handling of files to report on or ignore.
- Makefile.PL generates Inc.pm containing default @INC.
- added +inc, -ignore and -select.
-
-Release 0.07 - 17th August 2001
- - Add an API to Devel::Cover::DB.
-
-Release 0.06 - 10th August 2001
- - Rename Devel::Cover::Process to Devel::Cover::DB
- - Make the database a directory.
- - Add fix for eval in filename. (Arthur Bergman <arthur@contiller.se>)
- - Add more tests and abstract away comparison subroutine.
- - Clear @Inc if it is set explicitly.
- - Trim filename length in detailed output.
-
-Release 0.05 - 9th August 2001
- - Make line numbers more accurate when nextstate has been optimised away.
- - Get things working with ithreads.
-
-Release 0.04 - 12th April 2001
- - Include Devel::Cover::Op
- - Add condition coverage (sort of).
-
-Release 0.03 - 10th April 2001
- - Add detailed output.
- - Add -d option to turn it on.
-
-Release 0.02 - 10th April 2001
- - Add summary output.
- - Add -S option to turn it off.
- - Turn Devel::Cover::Process into a class.
-
-Release 0.01 - Initial release - 9th April 2001
@@ -438,8 +438,6 @@ static void cover_statement(pTHX_ OP *op)
static void cover_current_statement(pTHX)
{
- dMY_CXT;
-
#if CAN_PROFILE
cover_time(aTHX);
#endif
@@ -597,7 +595,6 @@ static void add_condition(pTHX_ SV *cond_ref, int value)
static void dump_conditions(pTHX)
{
- dMY_CXT;
HE *e;
MUTEX_LOCK(&DC_mutex);
@@ -621,7 +618,7 @@ static void dump_conditions(pTHX)
i = 2;
#endif
- NDEB(D(L, " %s: op %p, next %p (%d)\n",
+ PDEB(D(L, " %s: op %p, next %p (%d)\n",
hex_key(key), next, addr, av_len(conds) - 1));
for (; i <= av_len(conds); i++)
@@ -631,7 +628,7 @@ static void dump_conditions(pTHX)
int type = SvTRUE(*count) ? SvIV(*count) : 0;
sv_setiv(*count, 0);
- NDEB(D(L, " %2d: %p, %d\n", i - 2, op, type));
+ PDEB(D(L, " %2d: %p, %d\n", i - 2, op, type));
}
}
MUTEX_UNLOCK(&DC_mutex);
@@ -641,8 +638,6 @@ static void dump_conditions(pTHX)
static OP *get_condition(pTHX)
{
- dMY_CXT;
-
SV **pc = hv_fetch(Pending_conditionals, get_key(PL_op), KEY_SZ, 0);
if (pc && SvROK(*pc))
@@ -675,7 +670,6 @@ static void finalise_conditions(pTHX)
* to collect that lost information.
*/
- dMY_CXT;
HE *e;
MUTEX_LOCK(&DC_mutex);
@@ -859,6 +853,7 @@ static void cover_logop(pTHX)
static OP *dc_nextstate(pTHX)
{
dMY_CXT;
+ NDEB(D(L, "dc_nextstate\n"));
if (MY_CXT.covering) check_if_collecting(aTHX);
if (collecting_here(aTHX)) cover_current_statement(aTHX);
return CALL_FPTR(MY_CXT.ppaddr[OP_NEXTSTATE])(aTHX);
@@ -1222,7 +1217,6 @@ static SV *make_sv_object(pTHX_ SV *arg, SV *sv)
{
IV iv;
char *type;
- dMY_CXT;
iv = PTR2IV(sv);
type = svclassnames[SvTYPE(sv)];
@@ -1442,7 +1436,7 @@ BOOT:
replace_ops(aTHX);
}
else {
- PL_runops = runops_cover;
+ PL_runops = runops_cover;
}
#if PERL_VERSION > 6
PL_savebegin = TRUE;
@@ -1,11 +1,11 @@
.gitignore
-all_versions
-BUGS
-CHANGES
cover
Cover.xs
cpancover
-create_gold
+docs/BUGS
+docs/CHANGES
+docs/RELEASE
+docs/TODO
gcov2perl
lib/Devel/Cover.pm
lib/Devel/Cover/Annotation/Random.pm
@@ -39,13 +39,12 @@ lib/Devel/Cover/Truth_Table.pm
lib/Devel/Cover/Tutorial.pod
lib/Devel/Cover/Web.pm
Makefile.PL
-makeh
MANIFEST This list of files
MANIFEST.SKIP
META.yml
README
-scanuncov
-session.vim
+t/internal/criteria.t
+t/regexp/regexp_eval.t
tests/.uncoverable
tests/alias
tests/alias1
@@ -100,101 +99,137 @@ tests/t1
tests/t2
tests/trivial
tests/uncoverable
-TODO
typemap
+utils/all_versions
+utils/create_gold
+utils/Devel/Cover/BuildUtils.pm
utils/install/buildperl
utils/install/System.pm
+utils/makeh
+utils/scanuncov
+utils/session.vim
test_output/cover/alias.5.006001
test_output/cover/alias1.5.006001
test_output/cover/alias1.5.008
+test_output/cover/alias1.5.013005
test_output/cover/branch_return_sub.5.006001
test_output/cover/branch_return_sub.5.008
+test_output/cover/branch_return_sub.5.013005
test_output/cover/change.5.006001
test_output/cover/cond_and.5.006001
test_output/cover/cond_and.5.008
test_output/cover/cond_and.5.008001
+test_output/cover/cond_and.5.013005
test_output/cover/cond_branch.5.006001
test_output/cover/cond_branch.5.008
test_output/cover/cond_branch.5.008001
test_output/cover/cond_branch.5.012000
+test_output/cover/cond_branch.5.013001
+test_output/cover/cond_branch.5.013005
test_output/cover/cond_or.5.006001
test_output/cover/cond_or.5.006002
test_output/cover/cond_or.5.008
test_output/cover/cond_or.5.008001
test_output/cover/cond_or.5.010000
+test_output/cover/cond_or.5.013005
test_output/cover/cond_xor.5.006001
test_output/cover/cond_xor.5.008
test_output/cover/cond_xor.5.008001
+test_output/cover/cond_xor.5.013005
test_output/cover/default_param.5.006001
test_output/cover/default_param.5.008
test_output/cover/default_param.5.008001
+test_output/cover/default_param.5.013001
+test_output/cover/default_param.5.013005
test_output/cover/deparse.5.006001
test_output/cover/deparse.5.008
+test_output/cover/deparse.5.013005
test_output/cover/destroy.5.006001
test_output/cover/dynamic_subs.5.006001
test_output/cover/dynamic_subs.5.008
test_output/cover/dynamic_subs.5.008001
test_output/cover/dynamic_subs.5.008002
+test_output/cover/dynamic_subs.5.013005
test_output/cover/eval1.5.006001
test_output/cover/eval1.5.008
+test_output/cover/eval1.5.013005
test_output/cover/eval2.5.006001
test_output/cover/eval2.5.008
+test_output/cover/eval2.5.013005
test_output/cover/eval3.5.006001
test_output/cover/eval3.5.008
+test_output/cover/eval3.5.013005
test_output/cover/eval_sub.t.5.006001
test_output/cover/eval_sub.t.5.008
+test_output/cover/eval_sub.t.5.013005
test_output/cover/eval_use.t.5.006001
test_output/cover/eval_use.t.5.008
+test_output/cover/eval_use.t.5.013005
test_output/cover/exec.5.006001
test_output/cover/fork.5.006001
test_output/cover/if.5.006001
test_output/cover/if.5.008
+test_output/cover/if.5.013005
test_output/cover/inc_sub.5.006001
test_output/cover/inc_sub.5.008
test_output/cover/inc_sub.5.010000
+test_output/cover/inc_sub.5.013005
test_output/cover/md5.5.006001
test_output/cover/module1.5.006001
test_output/cover/module1.5.008
test_output/cover/module1.5.008001
+test_output/cover/module1.5.013005
test_output/cover/module2.5.006001
test_output/cover/module2.5.008
test_output/cover/module2.5.008001
+test_output/cover/module2.5.013005
test_output/cover/module_ignore.5.006001
test_output/cover/module_ignore.5.008
test_output/cover/module_ignore.5.008001
+test_output/cover/module_ignore.5.013005
test_output/cover/module_import.5.006001
test_output/cover/module_import.5.008
test_output/cover/module_import.5.008001
+test_output/cover/module_import.5.013005
test_output/cover/module_relative.5.006001
test_output/cover/module_relative.5.008
test_output/cover/module_relative.5.008001
+test_output/cover/module_relative.5.013005
test_output/cover/overload_bool.5.006001
test_output/cover/overload_bool.5.008
+test_output/cover/overload_bool.5.013005
test_output/cover/overloaded.5.006001
test_output/cover/overloaded.5.008
+test_output/cover/overloaded.5.013005
test_output/cover/pod.5.006001
test_output/cover/pod.5.008
test_output/cover/pod_nocp.5.006001
test_output/cover/pod_nocp.5.008
test_output/cover/require.5.006001
test_output/cover/require.5.008
+test_output/cover/require.5.013005
test_output/cover/skip.5.006001
test_output/cover/sort.5.006001
test_output/cover/sort.5.008
+test_output/cover/sort.5.013005
test_output/cover/special_blocks.5.006001
test_output/cover/special_blocks.5.008
test_output/cover/special_blocks.5.008001
test_output/cover/special_blocks.5.010000
+test_output/cover/special_blocks.5.013005
test_output/cover/statement.5.006001
test_output/cover/subs_only.5.006001
test_output/cover/t0.5.006001
test_output/cover/t0.5.008
test_output/cover/t0.5.008001
+test_output/cover/t0.5.013005
test_output/cover/t1.5.006001
test_output/cover/t1.5.008
+test_output/cover/t1.5.013005
test_output/cover/t2.5.006001
test_output/cover/t2.5.008
test_output/cover/t2.5.008001
+test_output/cover/t2.5.013005
test_output/cover/trivial.5.006001
test_output/cover/uncoverable.5.006001
test_output/cover/uncoverable.5.012000
@@ -7,7 +7,7 @@
^blib
^pm_to_blib$
\.version$
-^t/
+^t/e2e/
\.gz$
\.c$
\.o$
@@ -24,3 +24,4 @@ lib/Devel/Cover/Inc.pm$
^bugs/
.git/
.tar.bz2$
+^MYMETA.yml$
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Devel-Cover
-version: 0.68
+version: 0.72
abstract: Code coverage metrics for Perl
author:
- Paul Johnson (pjcj@cpan.org)
@@ -13,11 +13,13 @@ build_requires:
requires:
Digest::MD5: 0
Storable: 0
+ Test::More: 0
+ Test::Warn: 0
no_index:
directory:
- t
- inc
-generated_by: ExtUtils::MakeMaker version 6.55_02
+generated_by: ExtUtils::MakeMaker version 6.56
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
@@ -19,8 +19,8 @@ use File::Copy;
$| = 1;
-my $Version = "0.68";
-my $Date = "5th August 2010";
+my $Version = "0.72";
+my $Date = "27th September 2010";
my $Author = 'pjcj@cpan.org';
my @perlbug = ("perlbug", "-a", $Author,
@@ -86,11 +86,15 @@ close I or die "Cannot close lib/Devel/Cover/Inc.pm: $!";
print "Writing tests ........ ";
-unless (-d "t")
+for my $d (qw( t t/e2e ))
{
- mkdir "t" or die "Cannot mkdir t: $!";
+ unless (-d $d)
+ {
+ mkdir $d or die "Cannot mkdir $: $!";
+ }
}
+my @tests;
opendir D, "tests" or die "Cannot opendir tests: $!";
for my $t (readdir D)
{
@@ -98,13 +102,15 @@ for my $t (readdir D)
next if $t =~ /\.(pm|pl|org|bak|uncoverable)$/;
next if $t =~ /~$/;
+ push @tests, $t;
+
if ($t =~ /\.t/)
{
- copy("tests/$t", "t/$t") or die "Cannot copy tests/$t to t/$t: $!";
+ copy("tests/$t", "t/e2e/$t") or die "Cannot copy tests/$t to t/e2e/$t: $!";
next
}
- open T, ">t/a$t.t" or die "Cannot open t/a$t.t: $!";
+ open T, ">t/e2e/a$t.t" or die "Cannot open t/e2e/a$t.t: $!";
print T <<EOT;
#!$^X
@@ -127,20 +133,23 @@ use Devel::Cover::Test $Version;
Devel::Cover::Test->new("$t");
EOT
- close T or die "Cannot open t/a$t.t: $!";
+ close T or die "Cannot close t/e2e/a$t.t: $!";
}
closedir D or die "Cannot closedir tests: $!";
+s/^/tests\// for @tests;
+push @tests, grep !/e2e/, <t/*/*.t>;
+
print "done\n\n";
my $e;
-print "checking for Storable.pm ........ ";
+print "checking for Storable ........ ";
$e = <<EOM;
-Storable.pm is required to store the coverage database. You can
-download Storable from CPAN.
+Storable is required to store the coverage database. You can download
+Storable from CPAN.
EOM
@@ -155,12 +164,12 @@ else
print "not found\n\n$e\n";
}
-print "checking for Digest::MD5.pm ........ ";
+print "checking for Digest::MD5 ........ ";
$e = <<EOM;
-Digest::MD5.pm is required to check whether covered files have changed.
-You can download Digest::MD5 from CPAN.
+Digest::MD5 is required to check whether covered files have changed. You can
+download Digest::MD5 from CPAN.
EOM
@@ -175,11 +184,31 @@ else
print "not found\n\n$e\n";
}
-print "checking for Template.pm version 2.00 ........ ";
+print "checking for Test::More ........ ";
+
+$e = <<EOM;
+
+Test::More is required to run the Devel::Cover tests. You can download
+Test::More from CPAN.
+
+EOM
+
+eval "use Test::More";
+if (my $m = $INC{"Test/More.pm"})
+{
+ my $v = eval { no warnings; $Test::More::VERSION };
+ print "$v $m\n";
+}
+else
+{
+ print "not found\n\n$e\n";
+}
+
+print "checking for Template version 2.00 ........ ";
$e = <<EOM;
-Template.pm 2.00 is required to run the some HTML backends to cover and
+Template 2.00 is required to run the some HTML backends to cover and
for cpancover. Unless you have specific requirements this should not be
a problem, but you will not be able to use these reports until you
install the Template Toolkit, available from CPAN. In the meantime you
@@ -224,17 +253,6 @@ else
print "checking for Perl::Tidy version 20060719 .... ";
-$e = <<EOM;
-
-One of PPI::HTML 1.07 or Perl::Tidy 20060719 is required to add syntax
-highlighting to some HTML backends to cover and for cpancover. Unless
-you have specific requirements this should not be a problem, but you will
-not be able to use syntax highlighting in these reports until you install
-PPI::HTML or Perl::Tidy, available from the CPAN. In the meantime you
-may continue to use the rest of Devel::Cover.
-
-EOM
-
eval "use Perl::Tidy";
if (my $m = $INC{"Perl/Tidy.pm"})
{
@@ -246,11 +264,11 @@ else
print "not found\n\n$e\n";
}
-print "checking for Pod::Coverage.pm version 0.06 ........ ";
+print "checking for Pod::Coverage version 0.06 ........ ";
$e = <<EOM;
-Pod::Coverage.pm 0.06 is required to do pod coverage. This will tell
+Pod::Coverage 0.06 is required to do pod coverage. This will tell
you how well you have documented your modules. Pod coverage will be
unavailable until you install this module, available from CPAN. In the
meantime, you may continue to use the rest of Devel::Cover.
@@ -289,11 +307,11 @@ else
print "not found\n\n$e\n";
}
-print "checking for Test::Differences.pm ........ ";
+print "checking for Test::Differences ........ ";
$e = <<EOM;
-Test::Differences.pm is used to display output from failed tests.
+Test::Differences is used to display output from failed tests.
Hopefully there won't be any failed tests, but if there are you will get
output that may not be a model of clarity. If you do get test failures
and you fancy helping me by debugging them, then you might like to
@@ -306,14 +324,14 @@ eval "use Test::Differences";
if (my $m = $INC{"Test/Differences.pm"})
{
my $v = eval { no warnings; $Test::Differences::VERSION };
- print "$v $m\n";
+ printf "%-8s $m\n", $v;
}
else
{
print "not found\n\n$e\n";
}
-my $latest_tested = "5.012001";
+my $latest_tested = "5.012002";
print <<EOM if $] > $latest_tested;
Devel::Cover $Version has not been tested with perl $].
@@ -367,16 +385,19 @@ WriteMakefile
PREREQ_PM => {
Storable => 0,
"Digest::MD5" => 0,
+ "Test::More" => 0,
+ "Test::Warn" => 0,
},
dist => { COMPRESS => "gzip --best --force" },
- clean => { FILES => join " ", "t/*" },
- depend => { distdir => "@files" },
+ test => { TESTS => "t/*/*.t" },
+ clean => { FILES => join " ", "t/e2e/*" },
+ depend => { distdir => "@files" },
realclean => $] < 5.008008 ?
{
FILES => "lib/Devel/Cover/Inc.pm",
- POSTOP => "\$(RM_RF) cover_db t"
+ POSTOP => "\$(RM_RF) cover_db t/e2e"
} :
- { FILES => "lib/Devel/Cover/Inc.pm cover_db t" },
+ { FILES => "lib/Devel/Cover/Inc.pm cover_db t/e2e" },
);
print "\n";
@@ -414,6 +435,11 @@ sub MY::libscan
sub MY::postamble
{
+ my %tests;
+ @tests{@tests} = map { (my $t = $_) =~ s/\W/_/g; "cover_db_$t" } @tests;
+ my @reports =
+ qw(compilation html_basic html_minimal html html_subtle sort text2 text);
+
qq[
SET_VERSION = \$(PERL) -pi \\
-e 's/(^\\s*(?:our\\s+)\\\$\$VERSION = ")\\d+\\.\\d+(";)/\$\${1}$Version\$\$2/;' \\
@@ -468,32 +494,47 @@ text : out
wrun : pure_all
\t \$(PERL) \$(TAINT) -Iblib/lib -Iblib/arch -MDevel::Cover=-ignore,blib,-merge,0 tests/\$(TEST)
+prove : pure_all
+\t \$(PERL) -Iutils -MDevel::Cover::BuildUtils=prove_command -le '\$\$c = prove_command and print \$\$c and system \$\$c'
+
+tst : pure_all
+\t \$(PERL) -Iutils -MDevel::Cover::BuildUtils=prove_command -le '\$\$c = prove_command and print \$\$c and system \$\$c and system "make test"'
+
DB = cover_db
dump :
\t \$(PERL) -Mblib cover -dump_db \$(DB)
-FONT = 8x13
-FONT = -sun-screen-medium-r-normal-*-*-70-*-*-m-*-sun-fontspecific
-FONT = "Bitstream Vera Sans Mono 8"
+FONT = "Inconsolata 10"
GEOM = 260x85+0+0
diff : out
-\t \$(PERL) makeh strip_criterion 'time' \$(TEST).out
-\t \$(PERL) makeh strip_criterion ' pod' \$(TEST).out
+\t \$(PERL) utils/makeh strip_criterion 'time' \$(TEST).out
+\t \$(PERL) utils/makeh strip_criterion ' pod' \$(TEST).out
\t gvim -geom \$(GEOM) -d -font \$(FONT) `\$(PERL) -Mblib -MDevel::Cover::Test -e '\$\$t = Devel::Cover::Test->new("\$(TEST)", run_test_at_end => 0); print \$\$t->cover_gold'` \$(TEST).out
gold : pure_all
-\t \$(PERL) create_gold \$(TEST)
+\t \$(PERL) utils/create_gold \$(TEST)
all_test :
-\t exec \$(PERL) all_versions make test
+\t exec \$(PERL) utils/all_versions make test
all_gold :
\t rm -rf test_output
-\t exec \$(PERL) all_versions make gold
+\t exec \$(PERL) utils/all_versions make gold
+
+_delete_db : pure_all
+\t rm -rf cover_db
+
+_self_cover_tests : @{[sort values %tests]}
+\t DEVEL_COVER_SELF=1 \$(PERL) -Mblib -MDevel::Cover cover -silent -write cover_db @{[sort values %tests]} > /dev/null 2>&1
+
+self_cover : _self_cover_reports
+\t \$(PERL) -Mblib cover -report html_basic
mani :
+\t -rm MANIFEST
+\t \$(MAKE) manifest
\t \$(PERL) -i.bak -ne '\$\$d = "test_output/cover"; print unless /^\$\$d/; END { open M, ">>MANIFEST"; opendir D, \$\$d; print M "\$\$d/\$\$_\\n" for sort grep -f "\$\$d/\$\$_", readdir D }' MANIFEST
ok :
@@ -501,5 +542,19 @@ ok :
nok :
\t \@$Perlbug -nokay || echo "Please send your report manually to $Author"
- ]
+ ] . "\n" .
+ join "\n",
+
+ map("$tests{$_} : _delete_db\n" .
+ "\t \@echo Running $tests{$_}\n" .
+ "\t \@rm -rf $tests{$_}\n" .
+ "\t \@DEVEL_COVER_SELF=1 \$(PERL) -Mblib -MDevel::Cover=-db,$tests{$_},-silent,1,-coverage,all,-ignore,tests/,-coverage,pod-also_private-xx $_\n",
+ sort keys %tests),
+
+ "_self_cover_reports : @{[map qq(report_$_), @reports]}\n",
+
+ map("report_$_ : _self_cover_tests\n" .
+ "\t \@echo Generating $_ report\n" .
+ "\t \@DEVEL_COVER_SELF=1 \$(PERL) -Mblib -MDevel::Cover cover -silent -report $_\n",
+ @reports)
}
@@ -74,6 +74,9 @@ DESCRIPTION
be perl-qa. Discussion has migrated there from perl-qa-metrics which is
now defunct. See <http://lists.perl.org/showlist.cgi?name=perl-qa>.
+ The Devel::Cover repository can be found at
+ <http://github.com/pjcj/Devel--Cover>.
+
REQUIREMENTS
* Perl 5.6.1 or greater. Perl 5.8.2 or greater is recommended.
@@ -100,6 +103,14 @@ REQUIREMENTS
if you want Pod coverage.
+ * Test::More
+
+ in order to run the tests
+
+ * Test::Warn
+
+ in order to run some of the tests
+
* Test::Differences
if the tests fail and you would like nice output telling you why.
@@ -1,59 +0,0 @@
-- Enhancements:
- - Different criteria for different runs.
- - Marking of unreachable code - commandline tool and gui.
- - Threads support.
- - Test analysis.
- - Extend cpancover so people can upload databases.
- - Profiling and speedups.
- - Collect data for path coverage.
- - Mutation coverage.
- - Regular Expression coverage.
- - Indicate how to increase coverage?
- - Move away from Storable? To?
- - BEGIN and CHECK blocks and code in modules. Requires callbacks from perl?
- - Create a base class for Devel::Cover::Branch and Devel::Cover::Condition.
- - Handle C< $y || "${p}qqq" >.
- - 22:09 <@nothingmuch> return, redo, next, last, goto should probably all
- be treated as short circuiting
- - Add aliased subroutines to subroutine coverage.
- - Accommodate reloading modules at runtime (Mark Glines).
-- Reports:
- - Improve textual output.
- - Allow thresholds to be customisable in HTML output.
- - Move HTML version and platform info to main page and allow for multiples.
- - Add -db option to cover.
- - Diff functionality.
- - Merge CSS from basic_html and cpancover.
- - Provide a way to control syntax colouring.
-- Bugs:
- - Work with memoize. Is this still a problem?
- - See if the XS code leaks, and fix it if it does.
- - Look at time coverage again - collecting for too many ops?
- - Sort out time coverage on Windows.
- - Check for core dumps with pod coverage.
- - Uncovered dereferences as seen in svk.
- - Fix "ignored" errors - see IO::Pager.
- - cpancover on CPAN:
- - PerlIO-eol-0.13 hangs.
- - CPAN@1432 hangs with bleadperl@29642.
- - cover -delete uses too much memory when cover_db doesn't exist. (clkao)
- - Games::Bingo broken.
- - Class::Unload only giving 50% coverage on return unless ... (losing data?)
-- Testing:
- - Be able to run Devel::Cover on itself.
- - More comprehensive.
- - Functional tests.
- - Overhaul test system. Include patt?
- - Tests for INIT and END blocks included in required files when the
- files are used in some runs.
- - Make sure dor is handled correctly and add more tests to cond_or.
-- Build:
- - meta.yaml file to control pause indexing.
- - Fix up make text and friends for module_ignore.
- - Check for matching threadedness, 64bits etc. between build and run?
- - Turn Perl build lines into a script to work on Win32 etc.
-- Documentation:
- - General improvement.
- - Examples.
- - Document cpancover options.
- - Pod in private modules.
@@ -1,62 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
-
-# This software is free. It is licensed under the same terms as Perl itself.
-
-# The latest version of this software should be available from my homepage:
-# http://www.pjcj.net
-
-use strict;
-use warnings;
-
-use Getopt::Long;
-
-my $Options =
-{
- dry_run => 0,
- ignore_failure => 0,
- version => [],
-};
-
-sub get_options
-{
- die "Bad option" unless
- GetOptions($Options, # Store the options in the Options hash.
- qw(
- dry_run!
- ignore_failure!
- version=s
- ));
- $Options->{version} =
- [ map { ($_, "$_-thr") }
- qw( 5.6.1 5.6.2
- 5.8.0 5.8.1 5.8.2 5.8.3 5.8.4 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9
- 5.10.0 5.10.1 5.11.0 5.12.0 5.12.1 ) ]
- unless @{$Options->{version}};
- $Options->{version} =
- [ grep eval { !system "perl$_ -v" }, @{$Options->{version}} ];
-}
-
-sub sys
-{
- my ($command) = @_;
- print "$command\n";
- return if $Options->{dry_run};
- my $ret = system $command;
- die "command failed: $?" if $ret && !$Options->{ignore_failure};
-}
-
-get_options;
-my $command = "@ARGV" or die "Usage: $0 [-v version] command\n";
-
-for my $v (@{$Options->{version}})
-{
- my $perl = "perl$v";
- sys "rm -rf t cover_db";
- sys "$perl Makefile.PL";
- sys "make clean";
- sys "$perl Makefile.PL";
- sys "make";
- sys $command;
-}
@@ -12,12 +12,12 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
-use Devel::Cover::DB 0.68;
+use Devel::Cover::DB 0.72;
use Config;
-use Cwd "abs_path";
+use File::Spec;
use Data::Dumper;
use File::Find ();
use File::Path;
@@ -131,7 +131,7 @@ sub mb_test_command
sub main
{
- if ($INC{"Devel/Cover.pm"})
+ if (!$ENV{DEVEL_COVER_SELF} && $INC{"Devel/Cover.pm"})
{
my $err = "$0 shouldn't be run with coverage turned on.\n";
eval
@@ -180,12 +180,12 @@ sub main
pod2usage(-exitval => 0, -verbose => 1) if $Options->{help};
pod2usage(-exitval => 0, -verbose => 2) if $Options->{info};
- my $dbname = Cwd::abs_path(@ARGV ? shift @ARGV : "cover_db");
+ my $dbname = File::Spec->rel2abs(@ARGV ? shift @ARGV : "cover_db");
die "Can't open database $dbname\n"
if !$Options->{delete} && !$Options->{test} && !-d $dbname;
$Options->{outputdir} = $dbname unless exists $Options->{outputdir};
- my $od = Cwd::abs_path($Options->{outputdir});
+ my $od = File::Spec->rel2abs($Options->{outputdir});
$Options->{outputdir} = $od if defined $od;
mkpath($Options->{outputdir}) unless -d $Options->{outputdir};
@@ -223,17 +223,19 @@ sub main
{
return unless /\.(xs|c|h)$/;
+ my ($name) = /([^\/]+$)/;
+
# Don't bother running gcov if there's no index files.
# Otherwise it's noisy.
my $graph_file = $_;
$graph_file =~ s{\.\w+$}{.gcno};
return unless -e $graph_file;
- my $c = "gcov $_";
+ my $c = "gcov $name";
print STDERR "cover: running $c\n";
system $c;
};
- File::Find::find({ wanted => $gc, no_chdir => 0 }, ".");
+ File::Find::find({ wanted => $gc, no_chdir => 1 }, ".");
my @gc;
my $gp = sub
{
@@ -444,7 +446,7 @@ See the BUGS file.
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -12,14 +12,15 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
-use Devel::Cover::DB 0.68;
+use Devel::Cover::DB 0.72;
use Cwd ();
use Getopt::Long;
use Pod::Usage;
use Template 2.00;
+use Parallel::Iterator "iterate_as_array";
# use Carp; $SIG{__DIE__} = \&Carp::confess;
@@ -108,11 +109,14 @@ sub get_cover
my $db = "$d/cover_db";
print "Already analysed\n" if -d $db;
+ my $out = "cover.out";
+ unlink $out;
+
my $test = !-e "$db/runs" || $Options->{force} ? " -test" : "";
if ($test)
{
print "Testing $module\n";
- sys "$^X Makefile.PL" unless -e "Makefile";
+ sys "$^X Makefile.PL >> $out 2>&1" unless -e "Makefile";
}
my $od = "$Options->{outputdir}/$module";
@@ -126,7 +130,8 @@ sub get_cover
local $SIG{ALRM} = sub { die "alarm\n" };
alarm $timeout;
sys "cover$test -report $Options->{report} " .
- "-outputdir $od -outputfile $of";
+ "-outputdir $od -outputfile $of " .
+ ">> $out 2>&1";
alarm 0;
};
if ($@)
@@ -147,6 +152,8 @@ sub get_cover
print S "$mod $results->{$mod}\n";
}
close S or die "Can't close $f: $!\n";
+
+ sys "cat $out" if -e $out;
}
sub write_stylesheet
@@ -330,7 +337,15 @@ sub main
if ($Options->{collect})
{
- get_cover($_) for @{$Options->{module}};
+ my $workers = $ENV{CPANCOVER_WORKERS} || 0;
+ my @res = iterate_as_array
+ (
+ { workers => $workers },
+ sub { get_cover $_[1] },
+ $Options->{module}
+ );
+ use Data::Dumper; print Dumper \@res;
+ # get_cover($_) for @{$Options->{module}};
}
write_html;
@@ -341,7 +356,7 @@ package Devel::Cover::Cpancover::Template::Provider;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Template::Provider";
@@ -378,7 +393,7 @@ $Templates{html} = <<'EOT';
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
-This file was generated by Devel::Cover Version 0.68
+This file was generated by Devel::Cover Version 0.72
Devel::Cover is copyright 2001-2010, Paul Johnson (pjcj\@cpan.org)
Devel::Cover is free. It is licensed under the same terms as Perl itself.
The latest version of Devel::Cover should be available from my homepage:
@@ -479,7 +494,7 @@ The following exit values are returned:
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -1,51 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
-
-# This software is free. It is licensed under the same terms as Perl itself.
-
-# The latest version of this software should be available from my homepage:
-# http://www.pjcj.net
-
-require 5.6.1;
-
-use strict;
-use warnings;
-
-our $VERSION = "0.68";
-
-use blib;
-
-use Config;
-exit if $Config{useithreads};
-
-use Devel::Cover::Test 0.68;
-
-my @tests = @ARGV;
-
-mkdir "test_output" unless -d "test_output";
-mkdir "test_output/cover" unless -d "test_output/cover";
-
-unless (@tests)
-{
- opendir D, "tests" or die "Cannot opendir tests: $!";
- for my $t (sort readdir D)
- {
- next unless -f "tests/$t";
- next if $t =~ /\.(pm|pl|uncoverable|version|org|bak)$/;
- next if $t =~ /~$/;
-
- push @tests, $t;
- }
- closedir D or die "Cannot closedir tests: $!";
-}
-
-for my $test (@tests)
-{
- my $t = -e "t/$test" ? "t/$test" :
- -e "t/a$test.t" ? "t/a$test.t" :
- $test;
- print STDERR "creating golden results for $test\n";
- require $t or die "Can't require $t: $!";
- Devel::Cover::Test::test->create_gold;
-}
@@ -0,0 +1,23 @@
+- BEGIN and CHECK blocks and code in modules is not reported.
+
+- Doesn't play nicely with all of Perl's testsuite.
+
+- elsif and else coverage is reported on the same line as the if
+ statement. This is because perl doesn't store the line number for the
+ elsif and elses. For the same reason the following warning is
+ reported on line 1 rather than line 2:
+
+ perl -we 'if ($a) {}
+ elsif ($a + 1) {}'
+ Use of uninitialized value in addition (+) at -e line 1.
+
+- Pod coverage only reports data for modules, not top level scripts.
+ This is a limitation in Pod::Coverage.
+
+- Pod coverage does not work well with source filters including Switch.
+ Line numbers are reported incorrectly.
+
+- If an END block installs another END block it won't be covered. More
+ generally, any code run after Devel::Cover's END block won't be covered.
+
+- Empty subs will be ignored in Perl 5.8.1.
@@ -0,0 +1,541 @@
+Devel::Cover.pm history
+
+Release 0.72 - 27th September 2010
+ - Teach cpancover how to work in parallel.
+ - Improve speed of check_file() (Goro Fuji).
+ - Fix errors with non-existent directories on Cygwin (Goro Fuji).
+ - Improve self coverage with new test.
+ - Fix tests to work with 5.13.5.
+ - New dependency on Test::Warn.
+ - New dependency on Parallel::Iterator for cpancover.
+
+Release 0.71 - 10th September 2010
+ - Improve running of Devel::Cover on itself.
+ - Fix occasional parallel test failures.
+ - Test against 5.12.2.
+
+Release 0.70 - 29th August 2010
+ - Get Devel::Cover working better on itself.
+ - Distribution should now pass on 5.13.* development releases.
+
+Release 0.69 - 28th August 2010
+ - Correctly report on C<my $x = $y || return> and other shortcuts.
+ - Put end to end tests in t/e2e.
+ - Add test for regexp eval fail (Florian Ragwitz).
+ - Fix some warnings from strict compilers (Florian Ragwitz).
+ - Allow tests to run in parallel (Florian Ragwitz).
+ - Test against 5.13.* development releases.
+ - We now require Test::More to run the tests.
+
+Release 0.68 - 5th August 2010
+ - Fix gcov2perl to work with large numbers (Thomas Dorner) (rt 45028).
+ - Fix "gcov -l" include files (Thomas Dorner) (rt 44864).
+ - Test against 5.12.1.
+ - Gross workaround for for regexp evals (Florian Ragwitz).
+
+Release 0.67 - 8th May 2010
+ - Fix up the Makefile for dmake on Strawberry Perl (Curtis Jewell) (rt 50774).
+
+Release 0.66 - 12th April 2010
+ - Move to faster method of collecting data. Could be up to twice as fast now.
+ - Add -replace_ops options to be able to revert to previous collection method.
+ - Test against 5.12.0 and update tests as necessary.
+ - Work better with non-existent databases.
+ - XS fixes related to overriding ops rather than replacing runops
+ (Florian Ragwitz).
+ - Don't chmod created directories (mkdir should suffice).
+
+Release 0.65 - 8th August 2009
+ - Fix uninitialised value warning (reported by Andrew Billeb).
+ - Test against 5.8.9 and 5.10.1 (RC1).
+ - Correct deparsed conditional output in elsif conditions.
+ - Unset PERL5OPT when running tests.
+
+Release 0.64 - 10th April 2008
+ - Build on Windows.
+ - Make "cover -test" work for Module::Build (Michael G Schwern) (rt 34263).
+ - Make "cover -test" cover .[ch] files (Michael G Schwern) (rt 34262).
+ - Make "cover -gcov" a valid option (Michael G Schwern) (rt 34261).
+
+Release 0.63 - 16th November 2007
+ - require 5.006001 might stop CPAN testers trying to test with 5.005.
+ - store_return() should be a void function (H.Merijn Brand).
+ - Finish dor support.
+ - Add support for exec (Brandon Black).
+ - Tested against 5.10 (RC1).
+
+Release 0.62 - 5th November 2007
+ - Add table sorting to Html_basic report (Nathan Haigh).
+ - Assume heredocs are constants.
+ - Don't add 0x200 to $^P ("file" names for evals) (Fix for Template::Declare).
+ - Add timer and alarm for cpancover.
+ - Add Report Date to basic html report.
+ - Quieten some warnings.
+ - Document cover -test.
+ - Get rid of any __DIE__and __WARN__ signals during the report.
+ - Don't try to get a digest for "-e".
+ - Tidy up filename normalisation.
+ - Be more explicit about what I mean when I call this alpha software.
+ - Add uncoverable comments.
+ - Don't complain about POSIX.pm (Erwan Lemonnier).
+ - Don't resolve pathnames of symbolic links (Stefan Becker).
+ - Spelling nits (James E Keenen).
+
+Release 0.61 - 10th January 2007
+ - Fix some "ignored" errors due to multiple subs of the same name on the same
+ line (rt 14192).
+ - Display pod coverage with subroutine coverage in text report.
+ - Update golden output (tests were failing in 0.60).
+
+Release 0.60 - 2nd January 2007
+ - Simplify get_key function and remove TODO item (Gisle Aas).
+ - Be careful with UNC paths on Windows (John LoVerso) (rt 24105).
+ - Only call HvSHAREKEYS_off if threading is enabled.
+ - s/unvailable/unavailable/ (Jim Cromie).
+ - Don't key on op_targ - it might change (rt 22701).
+ - Tidy up docs and error messages for reports (rt 21098).
+ - Better database validation.
+ - Don't delete invalid datbases (rt 16039).
+ - Tested against 5.9.5.
+ - Allow for new anonlist and anonhash ops (rt 24067).
+ - Use outputfile for both cover and cpancover.
+ - Add compilation report (Denis Howe).
+
+Release 0.59 - 23rd August 2006
+ - Tidy up HTML, especially for cpancover.
+ - Allow coverage of subroutine statements in a different file (as with Mason)
+ (clkao).
+ - Bump refcount on subs to ensure they stay around for us to look at them
+ (yes, this is a hack).
+
+Release 0.58 - 6th August 2006
+ - Be more clever about void context and so avoid SvROK hack.
+ - Document some bugs, limitations and requirements.
+ - HTML alignment fix (Sébastien Aperghis-Tramoni).
+ - CSS improvements for HTML reports (Sébastien Aperghis-Tramoni).
+
+Release 0.57 - 3rd August 2006
+ - Report Pod::Coverage load failure (dom - happygiraffe.net) (rt 14425).
+ - Use Perl::Tidy as an alternative syntax highlighter
+ (Sébastien Aperghis-Tramoni).
+ - Lighten the style a little - make table cells only have right and bottom
+ borders, using the ones from the surrounding cells to form the grid
+ (Sébastien Aperghis-Tramoni).
+ - subs_only option to only show coverage for subs (Nicholas Clark).
+
+Release 0.56 - 1st August 2006
+ - gcov2perl creates db if necessary (Steve Peters) (rt 13536).
+ - Properly merge identical files (Jeff Wren) (rt 12410).
+ - Allow line achors in html_basic (Mark Stosberg) (rt 13615).
+ - Right justify numerical tabular html output (Sébastien Aperghis-Tramoni).
+ - Work around ExtUtils::MakeMaker realclean bug (Florian Ragwitz) (rt 17324).
+ - Don't try to delete db if it isn't there.
+ - The following changes were made at the Devel::Cover hackathon, sponsored by
+ Best Practical.
+ - No longer create the temporary .version files (Leon Brocard).
+ - Document Module::Build's testcover (Leon Brocard).
+ - Add more detail about code coverage in docs (Leon Brocard).
+ - Make the HTML valid by moving comment past the <?xml> (Leon Brocard).
+ - Add syntax highlighting to HTML_basic if PPI::HTML is installed
+ (Leon Brocard).
+ - Refactored common code for calculate_summary across all Criterion classes
+ (Norman Nunley).
+ - Remove duplicated code paths between Branch and Condition (Norman Nunley).
+ - Don't call overload bool in condition coverage (clkao).
+ - Fix the XML comment for cpancover (Norman Nunley).
+ - Turn conditionals in void context into or2 conditions so that the value of
+ the RHS doesn't matter for coverage purposes.
+ - Add a tool to scan comments about uncoverable code and output .uncoverable
+ format to stdout (clkao).
+ - Add and update overload tests.
+
+Release 0.55 - 22nd September 2005
+ - Add -gcov option to cover and make it default when using gcc.
+ - Remolve unused File::Find from cpancover.
+ - Document how to get XS coverage in gcov2perl.
+ - Improvements to SVK annotation (Chia-liang Kao).
+
+Release 0.54 - 13th September 2005
+ - Make html_basic prettier.
+ - Fix pod coverage percentages.
+ - Fix integer <-> pointer conversion warnings (Robin Barker).
+ - Add more tests for sort bug fixed in 0.53 (Rob Kinyon).
+ - Handle || bless {}, "XXX" (reported by Marcel Grünauer).
+ - Add preliminary dor support (unfinished).
+ - Test against perl-5.8.7.
+ - Add check for Pod::Coverage::CountParents.
+ - Fix line number display problem in conditionals in Html_basic.
+ - Add eval_sub and eval3 tests.
+ - Add buildperl script.
+ - Add -report option to cpancover.
+ - Update cpancover CSS.
+ - Partial solution for structure problems including debugging code.
+ - Add outputfile option to Html_basic.
+
+Release 0.53 - 17th April 2005
+ - Clean up database directories.
+ - Allow require File::Spec->catfile('t', 'common.pl'); (from an example by
+ Randy W. Sims).
+ - Fix core dump associated with sort subs and add test case supplied by
+ Leif Eriksen.
+ - Add extra options for coverage criteria.
+ - Allow pod coverage options to be specified.
+ - Update copyrights.
+ - Allow Test::Differences output to be displayed usefully.
+ - Test against perl-5.9.3.
+
+Release 0.52 - 13th December 2004
+ - Fix thread locking bug (Ruslan Zakirov).
+ - Make valgrind happy.
+ - Fix gcov2perl (Steve Peters).
+ - Restore failure message to CLONE.
+
+Release 0.51 - 29th November 2004
+ - Handle $y || undef.
+ - Small branch coverage fix.
+ - Improve reporting of uncoverable constructs in html reports.
+ - Test against perl-5.8.6.
+ - Recommend at least perl-5.8.2.
+
+Release 0.50 - 25th October 2004
+ - Add -test option to cover.
+ - Fix missing coverage when calling a sub in an ignored module.
+ - Add module_ignore test.
+ - Add uncoverable options to cover.
+
+Release 0.49 - 6th October 2004
+ - Compile on Win32 (and elsewhere) (Steve Hay).
+
+Release 0.48 - 5th October 2004
+ - Working towards thread safety.
+ - Test against perl-5.8.5.
+ - Store perl version number in Inc.pm and complain if it doesn't match.
+ - Add annotation API and Random example.
+ - Display run information in text report.
+ - Remove POSIX path bodge which is now properly fixed.
+ - Update test results for new functionality.
+ - Add -select_re and -ignore_re options to cover.
+ - Sort out "ignoring extra subroutine" and friends.
+ - Add eval2 and eval_use tests.
+ - Ignore *.t by default with blib.
+ - Add beginnings of sort report.
+ - Bump up DB version.
+ - Fix problems with references in INC (which can't be handled).
+ - Fixes for mod_perl (Vadim O. Ustiansky).
+
+Release 0.47 - 27th June 2004
+ - Provide subroutine coverage for empty subs - sub empty { }.
+ - Only override B::Deparse subs whilst using them and add deparse test.
+
+Release 0.46 - 23rd June 2004
+ - Don't lose data merging DBs.
+ - Work with Safe.pm, by not covering it.
+ - Swap Profiling_op for Profiling_key to avoid accessing freed memory.
+ - Rename -file and -exclude options in cover to -select and -ignore.
+ - Fully cover conditions and branches when the condition calls a sub in
+ an ignored file.
+
+Release 0.45 - 27th May 2004
+ - Cope with spaces in build path on Windows (Max Maischein).
+ - Allow Devel::Cover to be used under mod_perl (Philippe M. Chiasson).
+ - Handle $x ||= 1 and friends nicely, including subs and *foo{THING}.
+ - Allow uncoverable code to be specified. (Unfinished)
+
+Release 0.44 - 18th May 2004
+ - Fix get_elapsed, although its result is not used yet.
+ - Recommend 5.8.1 as a minimum.
+ - Replace run Makefile target with text and html.
+ - Fix up gcov2perl.
+ - Fail gracefully when covering a threaded program.
+ - Add DEVEL_COVER_OPTIONS environment variable.
+
+Release 0.43 - 2nd May 2004
+ - Add +ignore and +select options, and change meaning of -ignore and
+ -select options. This is an interface change.
+ - Ignore coverage on Devel::Cover's files by default.
+ - Cover INIT and END blocks more reliably.
+ - Fix 5.6 on Windows. Well, sort of.
+ - Add a message in Makefile.PL recommending against using Devel::Cover
+ on 5.6, especially under Windows.
+
+Release 0.42 - 30th April 2004
+ - Add SYNOPSIS section to README.
+ - Resolve links for Devel::Cover::Inc (Dave Rolsky).
+ - Get things running on Windows again.
+
+Release 0.41 - 29th April 2004
+ - Correct time coverage percentages.
+ - Collect data for BEGIN, CHECK, INIT and END blocks in the main
+ program, and INIT and END blocks in modules.
+ - Ensure our END block is always the last run.
+ - Don't clean up Pending_conditionals data.
+ - Untaint @INC after using blib.
+ - Be silent if called via HARNESS_PERL_SWITCHES.
+ - Test against perl-5.8.4.
+ - Store cwd from when each module was required in order to find them again.
+ - Refactor and tidy XS code.
+ - Get cpancover running again with the DB changes.
+ - Normalise filenames.
+
+Release 0.40 - 24th March 2004
+ - Remove DB structure for unwanted files.
+ - Identify ops based on address and OP contents, except for op_ppaddr,
+ which we modify.
+ - Overhaul of coverage collection.
+ - Additions to tests.
+
+Release 0.39 - 22nd March 2004
+ - Major database rework to store runs.
+ - Add Devel::Cover::DB::Structure.pm.
+ - Check for Test::Differences in Makefile.PL.
+ - Test with perl5.9.2.
+ - Skip fork test on MSWin32.
+
+Release 0.38 - 12th March 2004
+ - Allow coverage summary title to be changed (David Wheeler).
+ - More care generating pod golden results.
+ - Small Devel::Cover::Op output fix.
+ - Handle "my $x = shift || []" and friends nicely.
+ - Add default_param test.
+ - Provide summary output to one decimal place.
+ - Update gcov2perl.
+
+Release 0.37 - 10th March 2004
+ - Fix up pod test golden results.
+ - Add limitation documentation (Michael Carman).
+
+Release 0.36 - 9th March 2004
+ - Add fork test.
+ - Remove debugging code from md5 test.
+ - Remove runs after merging - code was commented out for debugging.
+ - Don't merge runs during coverage collection.
+ - Delete database at start if not merging to cope with forking.
+
+Release 0.35 - 8th March 2004
+ - Change Text2 to pick up version changes.
+ - Minor documentation updates.
+ - Minor changes to Devel::Cover::Op.
+ - Add outputfile option to HTML output (David Wheeler).
+ - Document -silent option to Devel::Cover.
+ - Add -silent option to cover (David Wheeler).
+ - Make Devel::Cover taint safe, or tolerant at least.
+ - Only add versioned golden results to tests that need them.
+ - Add trivial, md5 and module_no_inc tests.
+ - Increase flexibility of testing system to accomodate md5 test.
+ - Add mani, all_gold and all_test Makefile targets.
+ - Make all_versions skip non-existent platforms.
+ - Add DB option to make dump target.
+ - Remove dependencies on op_seq. (I removed it from bleadperl.) Use
+ op_targ instead.
+ - Collect some metadata.
+ - Documentation updates (Andy Lester).
+ - Document the mechanism by which files are selected for coverage.
+
+Release 0.34 - 14th January 2004
+ - Fix various warnings and errors that had crept in whilst working on
+ dynamic subs.
+
+Release 0.33 - 13th January 2004
+ - Get things working on paths with spaces in them.
+ - Documentation clarifications (Andy Lester).
+ - Fix coverage for simple if, elsif and unless conditionals.
+ - Add if test.
+ - Ensure runs are merged in the order they were created.
+ - Don't report multiple data from dynamically created subs.
+ - Add alias, alias1 and dynamic_subs tests.
+ - Fix and document Devel::Cover::Op.
+ - Redo subroutine coverage so anon subs are covered correctly in 5.6.x.
+
+Release 0.32 - 4th January 2004
+ - Actually include do test.
+ - Create run concept in database.
+ - Belatedly remove check for Template.
+ - Add branch_return_sub test.
+ - Add finalise_conditions() to collect previously missed coverage.
+ - Fix incorrect coverage results associated with "and" conditions.
+ - Add all_versions utility script.
+ - Put /usr/bin/perl on all shebang lines.
+
+Release 0.31 - 22nd December 2003
+ - Remove debugging output. Hmmm.
+
+Release 0.30 - 22nd December 2003
+ - Get things working under Windows.
+
+Release 0.29 - 19th December 2003
+ - Merge data from files with identical MD5 checksums (Arthur Bergman).
+ - Add do test.
+ - Handle $x || return.
+ - Keep cover -delete happy when there is no existing database.
+ - In cover, make -file a glob and add -exclude.
+ - Watch for coverage options being set in cover (PERL5OPT set?).
+ - Fix up html_basic and html_subtle.
+ - Make 5.6.x builds a bit quieter.
+ - Clean up time routines in XS code.
+
+Release 0.28 - 1st December 2003
+ - Remove leading whitespace from HTML templates (Gabor Szabo).
+ - Remove obsolete indent option.
+ - Add MD5 checksums (Michael Carman).
+ - Add Html_minimal.pm (Michael Carman) (Obsoleting Gabor's patch before it was
+ released).
+ - Pass unknown cover options to the formatter and remove -option.
+ - Specify the output directory for HTML.
+ - Search up directory trees for modules.
+
+Release 0.27 - 9th November 2003
+ - Behave sensibly if import() is not called, for example when MakeMaker does a
+ PREREQ_PM check.
+ - Use Storable for the database instead of Data::Dumper/eval (Michael Carman).
+
+Release 0.26 - 12th October 2003
+ - Decline to output HTML results for conditions containing > 16 terms.
+ - Add titles to HTML output.
+
+Release 0.25 - 10th October 2003
+ - Fix for perl 5.6.1. Cwd::abs_path($d) gets upset if $d doesn't exist.
+ - Start of some changes to cpancover HTML.
+
+Release 0.24 - 10th October 2003
+ - Paths in Devel::Cover::Inc in single quotes for Windows platforms.
+ - Add -dir option and default it to cwd.
+ - Ignore test.pl in cpancover.
+ - Display pod coverage in cpancover.
+
+Release 0.23 - 6th September 2003
+ - Report condition coverage for branches on the same line as the branch.
+ - Add subroutine coverage.
+ - Made "all" coverage value work and made it the default.
+
+Release 0.22 - 2nd September 2003
+ - Rewrite runops function.
+ - First line of DESTROY blocks and overload subs not now skipped.
+ - Add some more tests.
+
+Release 0.21 - 1st September 2003
+ - Add cpancover.
+ - Handle $x || next and friends.
+ - Add html_subtle and text2 backends (Michael Carman).
+ - Rename html backend to html_basic.
+ - Make html backend a wrapper around preferred style, currently html_subtle.
+ - Make time coverage a little more accurate. OK, a lot more accurate, it's at
+ least on the right line now, but I still wouldn't really trust it.
+ - Fix pod coverage which has been broken for a while.
+ - Don't collect branch coverage when not asked for.
+ - Provide golden results for different Perl versions.
+ - Change some B::Deparse logic to mirror changes in 5.8.1/5.10.
+
+Release 0.20 - 5th October 2002
+ - Add break after default to satisfy IBM's xlC compiler on AIX.
+ - Get things working with threads again.
+ - make realclean is.
+
+Release 0.19 - 29th September 2002
+ - Quieten uninitialised value warnings.
+
+Release 0.18 - 28th September 2002
+ - Redo the way condition coverage is gathered - abuse op_ppaddr.
+ - Put or conditions the right way round.
+ - Allow for subclasses of coverage types.
+ - Add:
+ Devel::Cover::Condition_or_2.pm
+ Devel::Cover::Condition_or_3.pm
+ Devel::Cover::Condition_and_3.pm
+ Devel::Cover::Condition_xor_4.pm
+ - "use" all conditions in Criterion.pm, and nowhere else.
+ - Add support for xor, ||= and &&=.
+
+Release 0.17 - 15th September 2002
+ - Call check_files() in report() to ensure we pick up anything added to the
+ symbol table while the program was running.
+
+Release 0.16 - 9th September 2002
+ - Get rid of some uninitialised warnings.
+ - Inline the HTML templates.
+ - Rebless the op after blessing it as a COP.
+ - Make branch coverage line numbers more accurate.
+
+Release 0.15 - 5th September 2002
+ - Reinstate coverage of subs in main:: which got lost somewhere (0.11?).
+ - Bug fixes for use of uninitialised values.
+ - Automatically generate tests. Well, their infrastructure anyway.
+ - Move Cover to lib/Devel/Cover to keep case insensitive filesystems happy.
+ - Remove -detail option. (It belongs to cover.)
+ - Work on op addresses and sequence numbers instead of just op addresses, to be
+ (almost) unique.
+ - Clean up subroutine location code.
+ - Fix -select to override anything else.
+ - Add condition coverage for && and || ops.
+ - Various changes in runops_cover to try to reduce runtime.
+ - Don't use runops_cover until CHECK time.
+ - Add merge, write and file options to cover.
+ - Add branch coverage.
+ - Abstract away cover backends.
+ - Use TT for HTML output.
+
+Release 0.14 - 28th February 2002
+ - Add a workaround for an AUTOLOAD bug in bleadperl.
+ - Add gcov2perl program to convert gcov files to Devel::Cover databases.
+ - Get rid of // comments in xs file.
+
+Release 0.13 - 14th October 2001
+ - Forgot to allow for lack of Pod::Coverage in Devel::Cover::Pod.pm.
+
+Release 0.12 - 14th October 2001
+ - Improve pod coverage by considering private subs.
+ - Add time coverage, aka profiling.
+ - Add:
+ Devel::Cover::DB::File.pm
+ Devel::Cover::Time.pm
+ - Abstract summary and percentage calculations to appropriate classes.
+
+Release 0.11 - 10th September 2001
+ - Add pod coverage based on Pod::Coverage.pm.
+ - Put a full API on the database.
+ - Add:
+ Devel::Cover::Criterion.pm
+ Devel::Cover::Statement.pm
+ Devel::Cover::Condition.pm
+ Devel::Cover::Pod.pm
+ - Some improvements to the cover program.
+
+Release 0.10 - 27th August 2001
+ - Add cover program to generate reports.
+
+Release 0.09 - 18th August 2001
+ - Beef up Devel::Cover::DB.
+
+Release 0.08 - 18th August 2001
+ - Provide better handling of files to report on or ignore.
+ Makefile.PL generates Inc.pm containing default @INC.
+ added +inc, -ignore and -select.
+
+Release 0.07 - 17th August 2001
+ - Add an API to Devel::Cover::DB.
+
+Release 0.06 - 10th August 2001
+ - Rename Devel::Cover::Process to Devel::Cover::DB
+ - Make the database a directory.
+ - Add fix for eval in filename. (Arthur Bergman <arthur@contiller.se>)
+ - Add more tests and abstract away comparison subroutine.
+ - Clear @Inc if it is set explicitly.
+ - Trim filename length in detailed output.
+
+Release 0.05 - 9th August 2001
+ - Make line numbers more accurate when nextstate has been optimised away.
+ - Get things working with ithreads.
+
+Release 0.04 - 12th April 2001
+ - Include Devel::Cover::Op
+ - Add condition coverage (sort of).
+
+Release 0.03 - 10th April 2001
+ - Add detailed output.
+ - Add -d option to turn it on.
+
+Release 0.02 - 10th April 2001
+ - Add summary output.
+ - Add -S option to turn it off.
+ - Turn Devel::Cover::Process into a class.
+
+Release 0.01 - Initial release - 9th April 2001
@@ -0,0 +1,42 @@
+Make sure the MANIFEST is up to date.
+ $ make mani
+
+Check for changes and commit if necessary.
+ $ git diff
+ $ git commit -v MANIFEST
+
+Update docs/CHANGES.
+ - Show the release number and date of release.
+ - Add important changes.
+ - Credit the author as appropriate.
+ - Include RT numbers.
+
+Commit the change.
+ $ git commit -m 'Add changes for X.YZ release' docs/CHANGES
+
+Update version number and date in Makefile.PL.
+ - Then propagate the change.
+ $ perl Makefile.PL && make
+
+Run basic tests.
+ $ make test
+
+Test against all versions.
+ $ make all_test
+ - or, if you have multiple cores available:
+ $ HARNESS_OPTIONS=j7:c HARNESS_TIMER=1 make all_test
+
+Return to base perl version.
+ $ perl Makefile.PL && make
+
+Run dist test.
+ $ make disttest
+
+Commit the change.
+ $ git commit -a -m 'Update to version X.YZ'
+
+Tag the release.
+ $ git tag -a vX.YZ -m 'Release vX.YZ'
+
+Make the distribution.
+ $ make dist
@@ -0,0 +1,59 @@
+- Enhancements:
+ - Different criteria for different runs.
+ - Marking of unreachable code - commandline tool and gui.
+ - Threads support.
+ - Test analysis.
+ - Extend cpancover so people can upload databases.
+ - Profiling and speedups.
+ - Collect data for path coverage.
+ - Mutation coverage.
+ - Regular Expression coverage.
+ - Indicate how to increase coverage?
+ - Move away from Storable? To?
+ - BEGIN and CHECK blocks and code in modules. Requires callbacks from perl?
+ - Create a base class for Devel::Cover::Branch and Devel::Cover::Condition.
+ - Handle C< $y || "${p}qqq" >.
+ - 22:09 <@nothingmuch> return, redo, next, last, goto should probably all
+ be treated as short circuiting
+ - Add aliased subroutines to subroutine coverage.
+ - Accommodate reloading modules at runtime (Mark Glines).
+- Reports:
+ - Improve textual output.
+ - Allow thresholds to be customisable in HTML output.
+ - Move HTML version and platform info to main page and allow for multiples.
+ - Add -db option to cover.
+ - Diff functionality.
+ - Merge CSS from basic_html and cpancover.
+ - Provide a way to control syntax colouring.
+- Bugs:
+ - Work with memoize. Is this still a problem?
+ - See if the XS code leaks, and fix it if it does.
+ - Look at time coverage again - collecting for too many ops?
+ - Sort out time coverage on Windows.
+ - Check for core dumps with pod coverage.
+ - Uncovered dereferences as seen in svk.
+ - Fix "ignored" errors - see IO::Pager.
+ - cpancover on CPAN:
+ - PerlIO-eol-0.13 hangs.
+ - CPAN@1432 hangs with bleadperl@29642.
+ - cover -delete uses too much memory when cover_db doesn't exist. (clkao)
+ - Games::Bingo broken.
+ - Class::Unload only giving 50% coverage on return unless ... (losing data?)
+- Testing:
+ - Be able to run Devel::Cover on itself.
+ - More comprehensive.
+ - Functional tests.
+ - Overhaul test system. Include patt?
+ - Tests for INIT and END blocks included in required files when the
+ files are used in some runs.
+ - Make sure dor is handled correctly and add more tests to cond_or.
+- Build:
+ - meta.yaml file to control pause indexing.
+ - Fix up make text and friends for module_ignore.
+ - Check for matching threadedness, 64bits etc. between build and run?
+ - Turn Perl build lines into a script to work on Win32 etc.
+- Documentation:
+ - General improvement.
+ - Examples.
+ - Document cpancover options.
+ - Pod in private modules.
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
-use Devel::Cover::DB 0.68;
+use Devel::Cover::DB 0.72;
use File::Path;
use File::Spec;
@@ -185,7 +185,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Annotation::Random;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use Getopt::Long;
@@ -103,7 +103,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Annotation::Svk;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use Getopt::Long;
use Digest::MD5;
@@ -175,7 +175,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Branch;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Devel::Cover::Criterion";
@@ -88,7 +88,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Condition;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Devel::Cover::Branch";
@@ -50,7 +50,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Condition_and_2;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Devel::Cover::Condition";
@@ -46,7 +46,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Condition_and_3;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Devel::Cover::Condition";
@@ -46,7 +46,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Condition_or_2;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Devel::Cover::Condition";
@@ -46,7 +46,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Condition_or_3;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Devel::Cover::Condition";
@@ -46,7 +46,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Condition_xor_4;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Devel::Cover::Condition";
@@ -45,7 +45,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,19 +10,19 @@ package Devel::Cover::Criterion;
use strict;
use warnings;
-our $VERSION = "0.68";
-
-use Devel::Cover::Statement 0.68;
-use Devel::Cover::Branch 0.68;
-use Devel::Cover::Condition 0.68;
-use Devel::Cover::Condition_or_2 0.68;
-use Devel::Cover::Condition_or_3 0.68;
-use Devel::Cover::Condition_and_2 0.68;
-use Devel::Cover::Condition_and_3 0.68;
-use Devel::Cover::Condition_xor_4 0.68;
-use Devel::Cover::Subroutine 0.68;
-use Devel::Cover::Time 0.68;
-use Devel::Cover::Pod 0.68;
+our $VERSION = "0.72";
+
+use Devel::Cover::Statement 0.72;
+use Devel::Cover::Branch 0.72;
+use Devel::Cover::Condition 0.72;
+use Devel::Cover::Condition_or_2 0.72;
+use Devel::Cover::Condition_or_3 0.72;
+use Devel::Cover::Condition_and_2 0.72;
+use Devel::Cover::Condition_and_3 0.72;
+use Devel::Cover::Condition_xor_4 0.72;
+use Devel::Cover::Subroutine 0.72;
+use Devel::Cover::Time 0.72;
+use Devel::Cover::Pod 0.72;
sub coverage { $_[0][0] }
sub information { $_[0][1] }
@@ -97,7 +97,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,9 +10,9 @@ package Devel::Cover::DB::File;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
-use Devel::Cover::Criterion 0.68;
+use Devel::Cover::Criterion 0.72;
sub calculate_summary
{
@@ -79,7 +79,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -16,7 +16,7 @@ use Storable;
use Devel::Cover::DB;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
our $AUTOLOAD;
sub new
@@ -207,7 +207,7 @@ sub digest
{
warn "Devel::Cover: Can't open $file for MD5 digest: $!\n"
unless lc $file eq "-e";
- # use Carp; print STDERR Carp::longmess("in " . `pwd`);
+ # print STDERR Carp::longmess("in " . `pwd`);
}
$digest
}
@@ -216,6 +216,7 @@ sub get_count
{
my $self = shift;
my ($criterion) = @_;
+ return 0 unless $self->{file}; # TODO - how does this get unset?
$self->{count}{$criterion}{$self->{file}}
}
@@ -251,7 +252,7 @@ sub write
$self->{f}{$file}{file} = $file;
unless ($self->{f}{$file}{digest})
{
- warn "Can't find digest for $file";
+ warn "Can't find digest for $file" unless $Devel::Cover::Silent;
next;
}
my $df = "$dir/$self->{f}{$file}{digest}";
@@ -323,7 +324,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,11 +10,11 @@ package Devel::Cover::DB;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
-use Devel::Cover::Criterion 0.68;
-use Devel::Cover::DB::File 0.68;
-use Devel::Cover::DB::Structure 0.68;
+use Devel::Cover::Criterion 0.72;
+use Devel::Cover::DB::File 0.72;
+use Devel::Cover::DB::Structure 0.72;
use Carp;
use File::Path;
@@ -711,6 +711,8 @@ sub cover
for my $run (@runs)
{
+ last unless $st;
+
my $r = $self->{runs}{$run};
@{$self->{collected}}{@{$r->{collected}}} = ();
$st->add_criteria(@{$r->{collected}});
@@ -1007,7 +1009,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -12,7 +12,7 @@ require 5.8.0; # My patches to B::Concise didn't get released till 5.8.0.
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use Devel::Cover qw( -ignore blib -ignore \\wB\\w );
use B::Concise qw( set_style add_callback );
@@ -112,7 +112,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Pod;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Devel::Cover::Criterion";
@@ -66,7 +66,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -18,9 +18,9 @@ package Devel::Cover::Report::Compilation;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
-use Devel::Cover::DB 0.68;
+use Devel::Cover::DB 0.72;
# TODO - uncoverable code?
@@ -169,7 +169,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Report::Html;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Devel::Cover::Report::Html_minimal";
@@ -46,7 +46,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,10 +10,10 @@ package Devel::Cover::Report::Html_basic;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
-use Devel::Cover::DB 0.68;
-use Devel::Cover::Web 0.68 "write_file";
+use Devel::Cover::DB 0.72;
+use Devel::Cover::Web 0.72 "write_file";
use Getopt::Long;
use Template 2.00;
@@ -42,6 +42,7 @@ sub class
{
my ($pc, $err, $criterion) = @_;
return "" if $criterion eq "time";
+ no warnings "uninitialized";
!$err ? "c3"
: $pc < 75 ? "c0"
: $pc < 90 ? "c1"
@@ -448,7 +449,7 @@ package Devel::Cover::Report::Html_basic::Template::Provider;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Template::Provider";
@@ -468,7 +469,7 @@ $Templates{html} = <<'EOT';
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
-This file was generated by Devel::Cover Version 0.68
+This file was generated by Devel::Cover Version 0.72
Devel::Cover is copyright 2001-2010, Paul Johnson (pjcj@cpan.org)
Devel::Cover is free. It is licensed under the same terms as Perl itself.
The latest version of Devel::Cover should be available from my homepage:
@@ -769,7 +770,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -4,10 +4,10 @@ use strict;
use warnings;
use CGI;
use Getopt::Long;
-use Devel::Cover::DB 0.68;
-use Devel::Cover::Truth_Table 0.68;
+use Devel::Cover::DB 0.72;
+use Devel::Cover::Truth_Table 0.72;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
#-------------------------------------------------------------------------------
# Subroutine : get_coverage_for_line
@@ -261,7 +261,7 @@ sub print_html_header {
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
-This file was generated by Devel::Cover Version 0.68
+This file was generated by Devel::Cover Version 0.72
Devel::Cover is copyright 2001-2010, Paul Johnson (pjcj\@cpan.org)
Devel::Cover is free. It is licensed under the same terms as Perl itself.
The latest version of Devel::Cover should be available from my homepage:
@@ -776,7 +776,7 @@ Devel::Cover
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -2,10 +2,10 @@ package Devel::Cover::Report::Html_subtle;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
-use Devel::Cover::DB 0.68;
-use Devel::Cover::Truth_Table 0.68;
+use Devel::Cover::DB 0.72;
+use Devel::Cover::Truth_Table 0.72;
use Template 2.00;
use CGI;
@@ -386,7 +386,7 @@ package Devel::Cover::Report::Html_subtle::Template::Provider;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Template::Provider";
@@ -404,7 +404,7 @@ sub fetch {
$Templates{html} = <<'EOT';
<?xml version="1.0" encoding="utf-8"?>
<!--
-This file was generated by Devel::Cover Version 0.68
+This file was generated by Devel::Cover Version 0.72
Devel::Cover is copyright 2001-2010, Paul Johnson (pjcj\@cpan.org)
Devel::Cover is free. It is licensed under the same terms as Perl itself.
The latest version of Devel::Cover should be available from my homepage:
@@ -728,7 +728,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,9 +10,9 @@ package Devel::Cover::Report::Sort;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
-use Devel::Cover::DB 0.68;
+use Devel::Cover::DB 0.72;
sub print_sort
{
@@ -95,7 +95,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,9 +10,9 @@ package Devel::Cover::Report::Text;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
-use Devel::Cover::DB 0.68;
+use Devel::Cover::DB 0.72;
sub print_runs
{
@@ -313,7 +313,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -2,9 +2,9 @@ package Devel::Cover::Report::Text2;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
-use Devel::Cover::DB 0.68;
+use Devel::Cover::DB 0.72;
use Devel::Cover::Truth_Table;
my %format = (
@@ -191,7 +191,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Statement;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Devel::Cover::Criterion";
@@ -51,7 +51,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,7 +10,7 @@ package Devel::Cover::Subroutine;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Devel::Cover::Criterion";
@@ -50,7 +50,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,14 +10,14 @@ package Devel::Cover::Test;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use Carp;
use File::Spec;
use Test;
-use Devel::Cover::Inc 0.68;
+use Devel::Cover::Inc 0.72;
my $Test;
@@ -70,9 +70,11 @@ sub get_params
. " -merge 0 -coverage $self->{criteria} "
. ($self->{test_parameters} || "");
$self->{criteria} =~ s/-\w+//g;
+ $self->{cover_db} = "$Devel::Cover::Inc::Base/t/e2e/cover_db_$self->{test}/";
+ mkdir $self->{cover_db};
$self->{cover_parameters} = join(" ", map "-coverage $_",
split " ", $self->{criteria})
- . " -report text";
+ . " -report text " . $self->{cover_db};
$self->{cover_parameters} .= " -uncoverable_file $self->{uncoverable_file}"
if $self->{uncoverable_file};
$self->{skip} = $self->{skip_reason}
@@ -111,7 +113,7 @@ sub test_command
unless ($ENV{DEVEL_COVER_NO_COVERAGE})
{
$c .= " -MDevel::Cover=" .
- join(",", split ' ', $self->{test_parameters})
+ join(",", '-db', $self->{cover_db}, split ' ', $self->{test_parameters})
}
$c .= " " . shell_quote $self->test_file;
$c .= " " . $self->test_file_parameters;
@@ -257,6 +259,12 @@ sub run_cover
print STDERR $_ if $debug;
redo if /^Devel::Cover: merging run/;
redo if /^Set up gcc environment/; # for MinGW
+ if (/Can't opendir\(.+\): No such file or directory/)
+ {
+ # parallel tests
+ scalar $get_line->();
+ redo;
+ }
s/^(Reading database from ).*/$1/;
s|(__ANON__\[) .* (/tests/ \w+ : \d+ \])|$1$2|x;
s/(Subroutine) +(Location)/$1 $2/;
@@ -10,7 +10,7 @@ package Devel::Cover::Time;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use base "Devel::Cover::Criterion";
@@ -71,7 +71,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -180,7 +180,7 @@ sub error {
package Devel::Cover::Truth_Table;
use warnings;
use strict;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
#-------------------------------------------------------------------------------
# Subroutine : new()
@@ -567,7 +567,7 @@ None that I'm aware of...
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENSE
@@ -163,7 +163,7 @@ basis for future research.
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -12,7 +12,7 @@ package Devel::Cover::Web;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use Exporter;
@@ -934,7 +934,7 @@ Huh?
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -10,13 +10,13 @@ package Devel::Cover;
use strict;
use warnings;
-our $VERSION = "0.68";
+our $VERSION = "0.72";
use DynaLoader ();
our @ISA = "DynaLoader";
-use Devel::Cover::DB 0.68;
-use Devel::Cover::Inc 0.68;
+use Devel::Cover::DB 0.72;
+use Devel::Cover::Inc 0.72;
use B qw( class ppname main_cv main_start main_root walksymtable OPf_KIDS );
use B::Debug;
@@ -45,10 +45,12 @@ my $Initialised; # import() has been called.
my $Dir; # Directory in which coverage will be
# collected.
-my $DB = "cover_db"; # DB name.
-my $Merge = 1; # Merge databases.
-my $Summary = 1; # Output coverage summary.
-my $Subs_only = 0; # Coverage only for sub bodies.
+my $DB = "cover_db"; # DB name.
+my $Merge = 1; # Merge databases.
+my $Summary = 1; # Output coverage summary.
+my $Subs_only = 0; # Coverage only for sub bodies.
+my $Self_cover; # Coverage of Devel::Cover.
+my $Self_cover_run = 0; # Covering Devel::Cover now.
my @Ignore; # Packages to ignore.
my @Inc; # Original @INC to ignore.
@@ -77,6 +79,10 @@ my %Coverage_options; # Options for overage criteria.
my %Run; # Data collected from the run.
+my $Const_right = qr/^(?:const|s?refgen|gelem|die|undef|bless|anon(?:list|hash)|
+ scalar|return|last|next|redo|goto)$/x;
+ # constant ops
+
use vars '$File', # Last filename we saw. (localised)
'$Line', # Last line number we saw. (localised)
'$Collect', # Whether or not we are collecting
@@ -84,7 +90,7 @@ use vars '$File', # Last filename we saw. (localised)
# over conditions. (localised)
'%Files', # Whether we are interested in files.
# Used in runops function.
- '$Replace_ops',
+ '$Replace_ops', # Whether we are replacing ops.
'$Silent'; # Output nothing. Can be used anywhere.
BEGIN
@@ -93,6 +99,12 @@ BEGIN
$Silent = ($ENV{HARNESS_PERL_SWITCHES} || "") =~ /Devel::Cover/ ||
($ENV{PERL5OPT} || "") =~ /Devel::Cover/;
*OUT = $ENV{DEVEL_COVER_DEBUG} ? *STDERR : *STDOUT;
+
+ @Inc = @Devel::Cover::Inc::Inc;
+ @Ignore = ("/Devel/Cover[./]") unless $Self_cover = $ENV{DEVEL_COVER_SELF};
+ # $^P = 0x004 | 0x010 | 0x100 | 0x200;
+ # $^P = 0x004 | 0x100 | 0x200;
+ $^P |= 0x004 | 0x100;
}
if (0 && $Config{useithreads})
@@ -154,11 +166,6 @@ if (0 && $Config{useithreads})
};
}
-BEGIN { @Inc = @Devel::Cover::Inc::Inc; @Ignore = ("/Devel/Cover[./]") }
-# BEGIN { $^P = 0x004 | 0x010 | 0x100 | 0x200 }
-# BEGIN { $^P = 0x004 | 0x100 | 0x200 }
-BEGIN { $^P = 0x004 | 0x100 }
-
{
sub check
{
@@ -250,7 +257,7 @@ EOM
POSIX::_exit(1);
}
-$Replace_ops = 1;
+$Replace_ops = !$Self_cover;
sub import
{
@@ -506,10 +513,10 @@ sub check_file
{
my ($cv) = @_;
- return unless class($cv) eq "CV";
+ return unless ref($cv) eq "B::CV";
my $op = $cv->START;
- return unless $op->can("file") && class($op) ne "NULL" && is_state($op);
+ return unless ref($op) eq "B::COP";
my $file = $op->file;
my $use = use_file($file);
@@ -601,8 +608,18 @@ sub check_files
@Subs = map $_->object_2svref, @Cvs if $] >= 5.008001;
}
+my %Seen;
+
sub report
{
+ _report();
+ return unless $Self_cover;
+ $Self_cover_run = 1;
+ _report();
+}
+
+sub _report
+{
local @SIG{qw(__DIE__ __WARN__)};
$Run{finish} = get_elapsed();
@@ -615,7 +632,7 @@ sub report
my @collected = get_coverage();
return unless @collected;
- set_coverage("none");
+ set_coverage("none") unless $Self_cover;
$Run{collected} = \@collected;
$Structure = Devel::Cover::DB::Structure->new(base => $DB);
@@ -681,19 +698,22 @@ sub report
structure => $Structure,
);
- $DB .= "/runs";
- unless (-d $DB)
+ my $dbrun = "$DB/runs";
+ unless (-d $dbrun)
{
- mkdir $DB, 0700 or croak "Can't mkdir $DB: $!\n";
+ mkdir $dbrun, 0700 or croak "Can't mkdir $dbrun: $!\n";
}
- $DB .= "/$run";
-
- $cover->{db} = $DB;
+ $dbrun .= "/$run";
- print OUT __PACKAGE__, ": Writing coverage database to $DB\n"
+ print OUT __PACKAGE__, ": Writing coverage database to $dbrun\n"
unless $Silent;
- $cover->write;
+ $cover->write($dbrun);
$cover->print_summary if $Summary && !$Silent;
+
+ return if !$Self_cover || $Self_cover_run;
+
+ $cover->delete;
+ delete $Run{vec};
}
sub add_subroutine_cover
@@ -739,8 +759,6 @@ sub add_statement_cover
if exists $Coverage->{time} && exists $Coverage->{time}{$key};
}
-my %Seen;
-
sub add_branch_cover
{
return unless $Collect && $Coverage{branch};
@@ -809,10 +827,14 @@ sub add_condition_cover
my $key = get_key($op);
# print STDERR "Condition cover $$op from $File:$Line\n";
+ # print STDERR "left: [$left]\nright: [$right]\n";
+ # use Carp "cluck"; cluck("from here");
my $type = $op->name;
+ # print STDERR "type: [$type]\n";
$type =~ s/assign$//;
$type = "or" if $type eq "dor";
+ # print STDERR "type: [$type]\n";
my $c = $Coverage->{condition}{$key};
@@ -827,11 +849,11 @@ sub add_condition_cover
$name = $r->first->name if $name eq "sassign";
# TODO - exec? any others?
# print STDERR "Name [$name]\n";
- if ($c->[5] || $name =~
- /^const|s?refgen|gelem|die|undef|bless|anon(?:list|hash)|scalar$/)
+ if ($c->[5] || $name =~ $Const_right)
{
$c = [ $c->[3], $c->[1] + $c->[2] ];
$count = 2;
+ # print STDERR "Special short circuit\n";
}
else
{
@@ -989,9 +1011,12 @@ sub logop
my ($op, $cx, $lowop, $lowprec, $highop, $highprec, $blockname) = @_;
my $left = $op->first;
my $right = $op->first->sibling;
+ # print STDERR "left [$left], right [$right]\n";
my ($file, $line) = ($File, $Line);
+
if ($cx < 1 && is_scope($right) && $blockname && $self->{expand} < 7)
{
+ # print STDERR 'if ($a) {$b}', "\n";
# if ($a) {$b}
{
# local $Collect;
@@ -1004,6 +1029,7 @@ sub logop
}
elsif ($cx < 1 && $blockname && !$self->{parens} && $self->{expand} < 7)
{
+ # print STDERR '$b if $a', "\n";
# $b if $a
{
# local $Collect;
@@ -1016,18 +1042,21 @@ sub logop
}
elsif ($cx > $lowprec && $highop)
{
+ # print STDERR '$a && $b', "\n";
# $a && $b
{
- # local $Collect;
+ local $Collect;
$left = $self->deparse_binop_left ($op, $left, $highprec);
$right = $self->deparse_binop_right($op, $right, $highprec);
}
+ # print STDERR "left [$left], right [$right]\n";
add_condition_cover($op, $highop, $left, $right)
unless $Seen{condition}{$$op}++;
return $self->maybe_parens("$left $highop $right", $cx, $highprec)
}
else
{
+ # print STDERR '$a and $b', "\n";
# $a and $b
{
# local $Collect;
@@ -1064,12 +1093,19 @@ sub get_cover
# print STDERR "get_cover: <$Sub_name>\n";
return unless defined $Sub_name; # Only happens within Safe.pm, AFAIK.
+ # return unless length $Sub_name; # Only happens with Self_cover, AFAIK.
get_location($start) if $start;
# print STDERR "[[$File:$Line]]\n";
# return unless length $File;
return if length $File && !use_file($File);
+ return if !$Self_cover_run && $File =~ /Devel\/Cover/;
+ return if $Self_cover_run && $File !~ /Devel\/Cover/;
+ return if $Self_cover_run &&
+ $File =~ /Devel\/Cover\.pm$/ &&
+ $Sub_name eq "import";
+
# printf STDERR "getting cover for $Sub_name ($start), %x\n", $$cv;
if ($start)
@@ -1250,6 +1286,9 @@ The most appropriate mailing list on which to discuss this module would
be perl-qa. Discussion has migrated there from perl-qa-metrics which is
now defunct. See L<http://lists.perl.org/showlist.cgi?name=perl-qa>.
+The Devel::Cover repository can be found at
+L<http://github.com/pjcj/Devel--Cover>.
+
=head1 REQUIREMENTS
=over
@@ -1279,6 +1318,14 @@ if you want syntax highlighted HTML reports.
if you want Pod coverage.
+=item * L<Test::More>
+
+in order to run the tests
+
+=item * L<Test::Warn>
+
+in order to run some of the tests
+
=item * L<Test::Differences>
if the tests fail and you would like nice output telling you why.
@@ -1442,7 +1489,7 @@ See the BUGS file. And the TODO file.
=head1 VERSION
-Version 0.68 - 5th August 2010
+Version 0.72 - 27th September 2010
=head1 LICENCE
@@ -1,37 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright 2001-2010, Paul Johnson (pjcj@cpan.org)
-
-# This software is free. It is licensed under the same terms as Perl itself.
-
-# The latest version of this software should be available from my homepage:
-# http://www.pjcj.net
-
-use strict;
-use warnings;
-
-my $Command =
-{
- strip_criterion => sub
- {
- my ($command, $criterion, $file) = @_;
- my $t;
- local ($^I, @ARGV) = (".bak", $file);
- while (<>)
- {
- $t = index $_, "$criterion code" if !defined $t || $t < 0;
- substr $_, $t, 7, ""
- if /^line err stmt/ .. /^--------/ and $t > -1 and length > $t;
- print;
- }
- },
-};
-
-sub main
-{
- my ($command) = @ARGV;
- die "No such command: $command" unless $Command->{$command};
- $Command->{$command}->(@ARGV)
-}
-
-main
@@ -1,18 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-use Digest::MD5;
-
-process_file($_) for @ARGV;
-
-sub process_file {
- my $file = shift;
- open my $fh, $file or die $!;
- while (<$fh>) {
- my ($count, $crit, $reason) = m/# uncoverable:\s+(\d+)\s+(\w+)\s+(.*$)/ or next;
- my $md5 = Digest::MD5->new->add($_)->hexdigest;
- $crit =~ s/s$//;
- for (0..$count-1) {
- print "$file $crit $md5 $_ 0 $reason\n";
- }
- }
-}
@@ -1,17 +0,0 @@
-1,999bd
-e Makefile.PL
-e MANIFEST
-e CHANGES
-e TODO
-e BUGS
-e lib/Devel/Cover.pm
-e lib/Devel/Cover/DB.pm
-e Cover.xs
-e cover
-e cpancover
-e lib/Devel/Cover/Test.pm
-e lib/Devel/Cover/Report/Text.pm
-e lib/Devel/Cover/Report/Html_minimal.pm
-e lib/Devel/Cover/Report/Html_basic.pm
-e #1
-Tlist
@@ -0,0 +1,36 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Warn;
+
+use Devel::Cover "-silent", 1;
+
+if ($] < 5.008000)
+{
+ plan skip_all => "Test requires perl 5.8.0 or greater";
+}
+else
+{
+ plan tests => 5;
+}
+
+Devel::Cover::set_coverage("none");
+is Devel::Cover::get_coverage(), "", "Set coverage to none empties coverage";
+
+Devel::Cover::set_coverage("all");
+is Devel::Cover::get_coverage(),
+ "branch condition path pod statement subroutine time",
+ "Set coverage to all fills coverage";
+
+Devel::Cover::remove_coverage("path");
+is Devel::Cover::get_coverage(),
+ "branch condition pod statement subroutine time",
+ "Removing path coverage works";
+
+warning_like { Devel::Cover::add_coverage("does_not_exist") }
+ qr/Devel::Cover: Unknown coverage criterion "does_not_exist" ignored./,
+ "Adding non-existent coverage warns";
+is Devel::Cover::get_coverage(),
+ "branch condition pod statement subroutine time",
+ "Adding non-existent coverage has no effect";
@@ -0,0 +1,37 @@
+use strict;
+use warnings;
+use Test::More tests => 1;
+
+# This tests against what is basically a perl bug. When evaluating
+# code within a regular expression, the state of the regular
+# expression engine may not be altered, i.e. no regex match may be
+# performed within a regular expression.
+#
+# The following code doesn't do that, but entering the eval within the
+# regular expression involves a nextstate OP. We hook, among other
+# things, into those opcodes, and execute some of our own
+# code. Devel::Cover::use_file, to be precise. That function currently
+# uses regular expressions, and therefore breaks shit.
+#
+# We currently avoid calling use_file at all within regexp evals. This
+# test makes sure we actually do, and will yell at us if we ever start
+# doing it again.
+#
+# CPAN RT#57174 is the corresponding Devel::Cover bug. This still
+# needs to be submitted to and fixed in perl core.
+
+'x' =~ m{ (?: ((??{ 'x' })) )? }x;
+
+# on debugging perls we'd already have hit an assertion failure
+# here. We don't do "pass 'no assertion fail'" tho. I don't know if
+# that might mess up $1 for the next test. We also have to use $1
+# instead of capturing in a lexical, as that tends to fail rather
+# differently.
+
+# on non-debugging perls, the above match tends to succeed, and only
+# rarely segfaults. Therefore we also make sure that the result is
+# correct. If we hit the bug, it tends to either contain complete
+# garbage, (parts of) some random constants from the perl interpreter,
+# or segfaults completely when invoking the get magic on it.
+
+is $1, 'x';
@@ -0,0 +1,109 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/Alias1.pm 100.0 100.0 n/a 100.0 100.0
+tests/alias1 100.0 n/a n/a 100.0 100.0
+Total 100.0 100.0 n/a 100.0 100.0
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/Alias1.pm
+
+line err stmt bran cond sub code
+1 # Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+2
+3 # This software is free. It is licensed under the same terms as Perl itself.
+4
+5 # The latest version of this software should be available from my homepage:
+6 # http://www.pjcj.net
+7
+8 package Alias1;
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 1 1 use Exporter;
+ 1
+14
+15 our @ISA = qw(Exporter);
+16 our @EXPORT = qw(is_3digits);
+17
+18 sub is_3digits {
+19 2 2 my $val = shift;
+20 2 my $retval = undef;
+21 2 100 $retval=1 if $val =~ /^\d{3}$/;
+22 2 return $retval;
+23 }
+24
+25 1;
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+21 100 1 1 if $val =~ /^\d{3}$/
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ------------------
+BEGIN 1 tests/Alias1.pm:10
+BEGIN 1 tests/Alias1.pm:11
+BEGIN 1 tests/Alias1.pm:13
+is_3digits 2 tests/Alias1.pm:19
+
+
+tests/alias1
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12 1 1 use lib "tests";
+ 1
+13
+14 1 1 use Alias1;
+ 1
+15
+16 1 is_3digits(1234);
+17 1 is_3digits(123);
+18
+19 1 exit;
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ---------------
+BEGIN 1 tests/alias1:10
+BEGIN 1 tests/alias1:11
+BEGIN 1 tests/alias1:12
+BEGIN 1 tests/alias1:14
+
+
@@ -0,0 +1,78 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/branch_return_sub 100.0 100.0 100.0 100.0 100.0
+Total 100.0 100.0 100.0 100.0 100.0
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/branch_return_sub
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 sub my_sqrt
+14 {
+15 3 3 my $n = shift;
+16
+17 3 100 100 if ( !defined($n) || ($n < 0) ) {
+18 2 return undef;
+19 }
+20
+21 1 return sqrt($n);
+22 }
+23
+24 1 my_sqrt(25);
+25 1 my_sqrt(-2);
+26 1 my_sqrt(undef);
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+17 100 2 1 if (not defined $n or $n < 0)
+
+
+Conditions
+----------
+
+or 3 conditions
+
+line err % l !l&&r !l&&!r expr
+----- --- ------ ------ ------ ------ ----
+17 100 1 1 1 not defined $n or $n < 0
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- --------------------------
+BEGIN 1 tests/branch_return_sub:10
+BEGIN 1 tests/branch_return_sub:11
+my_sqrt 3 tests/branch_return_sub:15
+
+
@@ -0,0 +1,124 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/cond_and 95.7 50.0 55.6 100.0 76.6
+Total 95.7 50.0 55.6 100.0 76.6
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/cond_and
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 1 my @x;
+14
+15 1 my $y = 1;
+16 1 my $z = 0;
+17
+18 1 for (0 .. 10)
+19 {
+20 *** 11 50 $y &&
+21 $x[1]++;
+22
+23 *** 11 100 66 $y &&
+24 $x[0]++ &&
+25 $x[1]++;
+26
+27 *** 11 50 $x[2]++
+28 if $z;
+29
+30 11 for (0 .. 2)
+31 {
+32 33 $x[3]++;
+33 }
+34
+35 *** 11 50 if ($y)
+36 {
+37 11 $x[4]++;
+38 }
+39 else
+40 {
+41 *** 0 0 $y && $x[5]++;
+42 }
+43
+44 11 my $p = $y & $z;
+45
+46 *** 11 50 $p &&= $y;
+47 *** 11 50 $p &&= $z;
+48 11 my $q = 1;
+49 *** 11 50 $q &&= $_;
+50
+51 11 pas();
+52 }
+53
+54 sub pas
+55 {
+56 *** 11 50 11 $y && $z
+57 }
+58
+59 # print join(", ", @x), "\n";
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+20 *** 50 11 0 if $y
+23 100 10 1 if $y and $x[0]++
+27 *** 50 0 11 if $z
+35 *** 50 11 0 if ($y) { }
+41 *** 0 0 0 if $y
+56 *** 50 11 0 if $y
+
+
+Conditions
+----------
+
+and 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+46 *** 50 11 0 $p &&= $y
+47 *** 50 11 0 $p &&= $z
+49 *** 50 0 11 $q &&= $_
+
+and 3 conditions
+
+line err % !l l&&!r l&&r expr
+----- --- ------ ------ ------ ------ ----
+23 *** 66 0 1 10 $y and $x[0]++
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -----------------
+BEGIN 1 tests/cond_and:10
+BEGIN 1 tests/cond_and:11
+pas 11 tests/cond_and:56
+
+
@@ -4,8 +4,8 @@ Reading database from ...
------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/cond_branch 82.5 79.3 19.1 100.0 68.7
-Total 82.5 79.3 19.1 100.0 68.7
+tests/cond_branch 85.3 79.3 32.9 100.0 73.0
+Total 85.3 79.3 32.9 100.0 73.0
------------------------------------------ ------ ------ ------ ------ ------
@@ -322,50 +322,119 @@ line err stmt bran cond sub code
273 *** 4 0 4 shift xor return;
274 *** 0 $x[44]++;
275 },
-276 1 );
-277
-278 1 for my $s (@s)
- 3
-279 {
-280 3 for my $y (0, 1)
- 6
-281 {
-282 6 $s->($y)
-283 }
-284
-285 3 for my $y (1, 0)
- 6
-286 {
-287 6 $s->($y)
-288 }
-289 }
-290
-291
-292 1 my ($a, $b) = (0, 1);
-293
-294 *** 1 50 33 if ($a && $b)
+276
+277 sub
+278 {
+279 4 100 4 my $x = shift || return;
+280 2 $x[45]++;
+281 },
+282
+283 sub
+284 {
+285 4 100 4 my $x = shift && return;
+286 2 $x[46]++;
+287 },
+288
+289 sub
+290 {
+291 4 4 my $x = shift;
+292 4 for my $y (1 .. 2)
+ 4
+293 {
+294 6 100 my $z = $x || last;
+295 4 $x[47]++;
+296 }
+297 },
+298
+299 sub
+300 {
+301 4 4 my $x = shift;
+302 4 for my $y (1 .. 2)
+ 8
+303 {
+304 8 100 my $z = $x || next;
+305 4 $x[48]++;
+306 }
+307 },
+308
+309 sub
+310 {
+311 4 4 my $x = shift;
+312 4 for my $y (1 .. 2)
+ 8
+313 {
+314 10 100 my $z = $x++ || redo;
+315 8 $x[49]++;
+316 }
+317 },
+318
+319 sub
+320 {
+321 4 4 my $x = shift;
+322 4 for my $y (1 .. 2)
+ 4
+323 {
+324 6 100 my $z = $x || goto GR;
+325 4 $x[50]++;
+326 }
+327 GR:
+328 4 },
+329
+330 sub
+331 {
+332 4 4 my $x = shift;
+333 4 for my $y (1 .. 2)
+ 8
+334 {
+335 8 100 eval { my $z = $x || die };
+ 8
+336 8 $x[51]++;
+337 }
+338 },
+339 1 );
+340
+341 1 for my $s (@s)
+ 10
+342 {
+343 10 for my $y (0, 1)
+ 20
+344 {
+345 20 $s->($y)
+346 }
+347
+348 10 for my $y (1, 0)
+ 20
+349 {
+350 20 $s->($y)
+351 }
+352 }
+353
+354
+355 1 my ($a, $b) = (0, 1);
+356
+357 *** 1 50 33 if ($a && $b)
*** 50 33
*** 50 50
-295 {
-296 *** 0 print "path 1\n";
-297 }
-298 elsif (!$a && !$b)
-299 {
-300 *** 0 print "path 2\n";
-301 }
-302 elsif ($b || 0)
-303 {
-304 1 print "path 3\n";
-305 *** 1 50 33 if (!$b || $a)
+358 {
+359 *** 0 print "path 1\n";
+360 }
+361 elsif (!$a && !$b)
+362 {
+363 *** 0 print "path 2\n";
+364 }
+365 elsif ($b || 0)
+366 {
+367 1 print "path 3\n";
+368 *** 1 50 33 if (!$b || $a)
*** 50 33
-306 {
-307 *** 0 print "path 4\n";
-308 }
-309 elsif (!$a && $b)
-310 {
-311 1 print "path 5\n";
-312 }
-313 }
+369 {
+370 *** 0 print "path 4\n";
+371 }
+372 elsif (!$a && $b)
+373 {
+374 1 print "path 5\n";
+375 }
+376 }
Branches
@@ -414,16 +483,22 @@ line err % true false branch
249 100 1 2 if $z > 1
260 100 2 2 unless shift @_
266 100 2 2 if shift @_
-294 *** 50 0 1 if ($a and $b) { }
+357 *** 50 0 1 if ($a and $b) { }
*** 50 0 1 elsif (not $a and not $b) { }
*** 50 1 0 elsif ($b or 0) { }
-305 *** 50 0 1 if (not $b or $a) { }
+368 *** 50 0 1 if (not $b or $a) { }
*** 50 1 0 elsif (not $a and $b) { }
Conditions
----------
+and 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+285 100 2 2 shift @_ && return
+
and 3 conditions
line err % !l l&&!r l&&r expr
@@ -432,15 +507,21 @@ line err % !l l&&!r l&&r expr
51 *** 33 4 0 0 $y and $z
68 *** 33 4 0 0 $y and $z
*** 33 4 0 0 $y and $z
-294 *** 33 1 0 0 $a and $b
+357 *** 33 1 0 0 $a and $b
*** 33 0 1 0 not $a and not $b
-305 *** 33 0 0 1 not $a and $b
+368 *** 33 0 0 1 not $a and $b
or 2 conditions
line err % l !l expr
----- --- ------ ------ ------ ----
-294 *** 50 1 0 $b or 0
+279 100 2 2 shift @_ || return
+294 100 4 2 $x || last
+304 100 4 4 $x || next
+314 100 8 2 $x++ || redo
+324 100 4 2 $x || goto GR
+335 100 4 4 $x || die
+357 *** 50 1 0 $b or 0
or 3 conditions
@@ -448,7 +529,7 @@ line err % l !l&&r !l&&!r expr
----- --- ------ ------ ------ ------ ----
27 *** 66 0 2 2 $y or $z
51 *** 66 0 2 2 $y or $z
-305 *** 33 0 0 1 not $b or $a
+368 *** 33 0 0 1 not $b or $a
xor 4 conditions
@@ -473,5 +554,12 @@ Subroutine Count Location
__ANON__ 4 tests/cond_branch:260
__ANON__ 4 tests/cond_branch:266
__ANON__ 4 tests/cond_branch:273
+__ANON__ 4 tests/cond_branch:279
+__ANON__ 4 tests/cond_branch:285
+__ANON__ 4 tests/cond_branch:291
+__ANON__ 4 tests/cond_branch:301
+__ANON__ 4 tests/cond_branch:311
+__ANON__ 4 tests/cond_branch:321
+__ANON__ 4 tests/cond_branch:332
@@ -4,8 +4,8 @@ Reading database from ...
------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/cond_branch 85.4 79.3 19.1 100.0 72.4
-Total 85.4 79.3 19.1 100.0 72.4
+tests/cond_branch 87.4 79.3 32.9 100.0 75.8
+Total 87.4 79.3 32.9 100.0 75.8
------------------------------------------ ------ ------ ------ ------ ------
@@ -344,50 +344,119 @@ line err stmt bran cond sub code
273 *** 4 0 4 shift xor return;
274 *** 0 $x[44]++;
275 },
-276 1 );
-277
-278 1 for my $s (@s)
- 3
-279 {
-280 3 for my $y (0, 1)
- 6
-281 {
-282 6 $s->($y)
-283 }
-284
-285 3 for my $y (1, 0)
- 6
-286 {
-287 6 $s->($y)
-288 }
-289 }
-290
-291
-292 1 my ($a, $b) = (0, 1);
-293
-294 *** 1 50 33 if ($a && $b)
+276
+277 sub
+278 {
+279 4 100 4 my $x = shift || return;
+280 2 $x[45]++;
+281 },
+282
+283 sub
+284 {
+285 4 100 4 my $x = shift && return;
+286 2 $x[46]++;
+287 },
+288
+289 sub
+290 {
+291 4 4 my $x = shift;
+292 4 for my $y (1 .. 2)
+ 4
+293 {
+294 6 100 my $z = $x || last;
+295 4 $x[47]++;
+296 }
+297 },
+298
+299 sub
+300 {
+301 4 4 my $x = shift;
+302 4 for my $y (1 .. 2)
+ 8
+303 {
+304 8 100 my $z = $x || next;
+305 4 $x[48]++;
+306 }
+307 },
+308
+309 sub
+310 {
+311 4 4 my $x = shift;
+312 4 for my $y (1 .. 2)
+ 8
+313 {
+314 10 100 my $z = $x++ || redo;
+315 8 $x[49]++;
+316 }
+317 },
+318
+319 sub
+320 {
+321 4 4 my $x = shift;
+322 4 for my $y (1 .. 2)
+ 4
+323 {
+324 6 100 my $z = $x || goto GR;
+325 4 $x[50]++;
+326 }
+327 GR:
+328 4 },
+329
+330 sub
+331 {
+332 4 4 my $x = shift;
+333 4 for my $y (1 .. 2)
+ 8
+334 {
+335 8 100 eval { my $z = $x || die };
+ 8
+336 8 $x[51]++;
+337 }
+338 },
+339 1 );
+340
+341 1 for my $s (@s)
+ 10
+342 {
+343 10 for my $y (0, 1)
+ 20
+344 {
+345 20 $s->($y)
+346 }
+347
+348 10 for my $y (1, 0)
+ 20
+349 {
+350 20 $s->($y)
+351 }
+352 }
+353
+354
+355 1 my ($a, $b) = (0, 1);
+356
+357 *** 1 50 33 if ($a && $b)
*** 50 33
*** 50 50
-295 {
-296 *** 0 print "path 1\n";
-297 }
-298 elsif (!$a && !$b)
-299 {
-300 *** 0 print "path 2\n";
-301 }
-302 elsif ($b || 0)
-303 {
-304 1 print "path 3\n";
-305 *** 1 50 33 if (!$b || $a)
+358 {
+359 *** 0 print "path 1\n";
+360 }
+361 elsif (!$a && !$b)
+362 {
+363 *** 0 print "path 2\n";
+364 }
+365 elsif ($b || 0)
+366 {
+367 1 print "path 3\n";
+368 *** 1 50 33 if (!$b || $a)
*** 50 33
-306 {
-307 *** 0 print "path 4\n";
-308 }
-309 elsif (!$a && $b)
-310 {
-311 1 print "path 5\n";
-312 }
-313 }
+369 {
+370 *** 0 print "path 4\n";
+371 }
+372 elsif (!$a && $b)
+373 {
+374 1 print "path 5\n";
+375 }
+376 }
Branches
@@ -436,16 +505,22 @@ line err % true false branch
249 100 1 2 if $z > 1
260 100 2 2 unless shift @_
266 100 2 2 if shift @_
-294 *** 50 0 1 if ($a and $b) { }
+357 *** 50 0 1 if ($a and $b) { }
*** 50 0 1 elsif (not $a and not $b) { }
*** 50 1 0 elsif ($b or 0) { }
-305 *** 50 0 1 if (not $b or $a) { }
+368 *** 50 0 1 if (not $b or $a) { }
*** 50 1 0 elsif (not $a and $b) { }
Conditions
----------
+and 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+285 100 2 2 shift @_ && return
+
and 3 conditions
line err % !l l&&!r l&&r expr
@@ -454,15 +529,21 @@ line err % !l l&&!r l&&r expr
51 *** 33 4 0 0 $y and $z
68 *** 33 4 0 0 $y and $z
*** 33 4 0 0 $y and $z
-294 *** 33 1 0 0 $a and $b
+357 *** 33 1 0 0 $a and $b
*** 33 0 1 0 not $a and not $b
-305 *** 33 0 0 1 not $a and $b
+368 *** 33 0 0 1 not $a and $b
or 2 conditions
line err % l !l expr
----- --- ------ ------ ------ ----
-294 *** 50 1 0 $b or 0
+279 100 2 2 shift @_ || return
+294 100 4 2 $x || last
+304 100 4 4 $x || next
+314 100 8 2 $x++ || redo
+324 100 4 2 $x || goto GR
+335 100 4 4 $x || die
+357 *** 50 1 0 $b or 0
or 3 conditions
@@ -470,7 +551,7 @@ line err % l !l&&r !l&&!r expr
----- --- ------ ------ ------ ------ ----
27 *** 66 0 2 2 $y or $z
51 *** 66 0 2 2 $y or $z
-305 *** 33 0 0 1 not $b or $a
+368 *** 33 0 0 1 not $b or $a
xor 4 conditions
@@ -506,5 +587,12 @@ BEGIN 1 tests/cond_branch:99
__ANON__ 4 tests/cond_branch:260
__ANON__ 4 tests/cond_branch:266
__ANON__ 4 tests/cond_branch:273
+__ANON__ 4 tests/cond_branch:279
+__ANON__ 4 tests/cond_branch:285
+__ANON__ 4 tests/cond_branch:291
+__ANON__ 4 tests/cond_branch:301
+__ANON__ 4 tests/cond_branch:311
+__ANON__ 4 tests/cond_branch:321
+__ANON__ 4 tests/cond_branch:332
@@ -4,8 +4,8 @@ Reading database from ...
------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/cond_branch 88.8 79.3 19.1 100.0 73.0
-Total 88.8 79.3 19.1 100.0 73.0
+tests/cond_branch 90.3 79.3 32.9 100.0 76.2
+Total 90.3 79.3 32.9 100.0 76.2
------------------------------------------ ------ ------ ------ ------ ------
@@ -318,47 +318,111 @@ line err stmt bran cond sub code
273 *** 4 0 4 shift xor return;
274 *** 0 $x[44]++;
275 },
-276 1 );
-277
-278 1 for my $s (@s)
-279 {
-280 3 for my $y (0, 1)
-281 {
-282 6 $s->($y)
-283 }
-284
-285 3 for my $y (1, 0)
-286 {
-287 6 $s->($y)
-288 }
-289 }
-290
-291
-292 1 my ($a, $b) = (0, 1);
-293
-294 *** 1 50 33 if ($a && $b)
+276
+277 sub
+278 {
+279 4 100 4 my $x = shift || return;
+280 2 $x[45]++;
+281 },
+282
+283 sub
+284 {
+285 4 100 4 my $x = shift && return;
+286 2 $x[46]++;
+287 },
+288
+289 sub
+290 {
+291 4 4 my $x = shift;
+292 4 for my $y (1 .. 2)
+293 {
+294 6 100 my $z = $x || last;
+295 4 $x[47]++;
+296 }
+297 },
+298
+299 sub
+300 {
+301 4 4 my $x = shift;
+302 4 for my $y (1 .. 2)
+303 {
+304 8 100 my $z = $x || next;
+305 4 $x[48]++;
+306 }
+307 },
+308
+309 sub
+310 {
+311 4 4 my $x = shift;
+312 4 for my $y (1 .. 2)
+313 {
+314 10 100 my $z = $x++ || redo;
+315 8 $x[49]++;
+316 }
+317 },
+318
+319 sub
+320 {
+321 4 4 my $x = shift;
+322 4 for my $y (1 .. 2)
+323 {
+324 6 100 my $z = $x || goto GR;
+325 4 $x[50]++;
+326 }
+327 GR:
+328 4 },
+329
+330 sub
+331 {
+332 4 4 my $x = shift;
+333 4 for my $y (1 .. 2)
+334 {
+335 8 100 eval { my $z = $x || die };
+ 8
+336 8 $x[51]++;
+337 }
+338 },
+339 1 );
+340
+341 1 for my $s (@s)
+342 {
+343 10 for my $y (0, 1)
+344 {
+345 20 $s->($y)
+346 }
+347
+348 10 for my $y (1, 0)
+349 {
+350 20 $s->($y)
+351 }
+352 }
+353
+354
+355 1 my ($a, $b) = (0, 1);
+356
+357 *** 1 50 33 if ($a && $b)
*** 50 33
*** 50 50
-295 {
-296 *** 0 print "path 1\n";
-297 }
-298 elsif (!$a && !$b)
-299 {
-300 *** 0 print "path 2\n";
-301 }
-302 elsif ($b || 0)
-303 {
-304 1 print "path 3\n";
-305 *** 1 50 33 if (!$b || $a)
+358 {
+359 *** 0 print "path 1\n";
+360 }
+361 elsif (!$a && !$b)
+362 {
+363 *** 0 print "path 2\n";
+364 }
+365 elsif ($b || 0)
+366 {
+367 1 print "path 3\n";
+368 *** 1 50 33 if (!$b || $a)
*** 50 33
-306 {
-307 *** 0 print "path 4\n";
-308 }
-309 elsif (!$a && $b)
-310 {
-311 1 print "path 5\n";
-312 }
-313 }
+369 {
+370 *** 0 print "path 4\n";
+371 }
+372 elsif (!$a && $b)
+373 {
+374 1 print "path 5\n";
+375 }
+376 }
Branches
@@ -407,16 +471,22 @@ line err % true false branch
249 100 1 2 if $z > 1
260 100 2 2 unless shift @_
266 100 2 2 if shift @_
-294 *** 50 0 1 if ($a and $b) { }
+357 *** 50 0 1 if ($a and $b) { }
*** 50 0 1 elsif (not $a and not $b) { }
*** 50 1 0 elsif ($b or 0) { }
-305 *** 50 0 1 if (not $b or $a) { }
+368 *** 50 0 1 if (not $b or $a) { }
*** 50 1 0 elsif (not $a and $b) { }
Conditions
----------
+and 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+285 100 2 2 shift @_ && return
+
and 3 conditions
line err % !l l&&!r l&&r expr
@@ -425,15 +495,21 @@ line err % !l l&&!r l&&r expr
51 *** 33 4 0 0 $y and $z
68 *** 33 4 0 0 $y and $z
*** 33 4 0 0 $y and $z
-294 *** 33 1 0 0 $a and $b
+357 *** 33 1 0 0 $a and $b
*** 33 0 1 0 not $a and not $b
-305 *** 33 0 0 1 not $a and $b
+368 *** 33 0 0 1 not $a and $b
or 2 conditions
line err % l !l expr
----- --- ------ ------ ------ ----
-294 *** 50 1 0 $b or 0
+279 100 2 2 shift @_ || return
+294 100 4 2 $x || last
+304 100 4 4 $x || next
+314 100 8 2 $x++ || redo
+324 100 4 2 $x || goto GR
+335 100 4 4 $x || die
+357 *** 50 1 0 $b or 0
or 3 conditions
@@ -441,7 +517,7 @@ line err % l !l&&r !l&&!r expr
----- --- ------ ------ ------ ------ ----
27 *** 66 0 2 2 $y or $z
51 *** 66 0 2 2 $y or $z
-305 *** 33 0 0 1 not $b or $a
+368 *** 33 0 0 1 not $b or $a
xor 4 conditions
@@ -477,5 +553,12 @@ BEGIN 1 tests/cond_branch:99
__ANON__ 4 tests/cond_branch:260
__ANON__ 4 tests/cond_branch:266
__ANON__ 4 tests/cond_branch:273
+__ANON__ 4 tests/cond_branch:279
+__ANON__ 4 tests/cond_branch:285
+__ANON__ 4 tests/cond_branch:291
+__ANON__ 4 tests/cond_branch:301
+__ANON__ 4 tests/cond_branch:311
+__ANON__ 4 tests/cond_branch:321
+__ANON__ 4 tests/cond_branch:332
@@ -4,8 +4,8 @@ Reading database from ...
------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/cond_branch 88.8 79.3 19.1 100.0 73.0
-Total 88.8 79.3 19.1 100.0 73.0
+tests/cond_branch 90.3 79.3 32.9 100.0 76.2
+Total 90.3 79.3 32.9 100.0 76.2
------------------------------------------ ------ ------ ------ ------ ------
@@ -318,47 +318,111 @@ line err stmt bran cond sub code
273 *** 4 0 4 shift xor return;
274 *** 0 $x[44]++;
275 },
-276 1 );
-277
-278 1 for my $s (@s)
-279 {
-280 3 for my $y (0, 1)
-281 {
-282 6 $s->($y)
-283 }
-284
-285 3 for my $y (1, 0)
-286 {
-287 6 $s->($y)
-288 }
-289 }
-290
-291
-292 1 my ($a, $b) = (0, 1);
-293
-294 *** 1 50 33 if ($a && $b)
+276
+277 sub
+278 {
+279 4 100 4 my $x = shift || return;
+280 2 $x[45]++;
+281 },
+282
+283 sub
+284 {
+285 4 100 4 my $x = shift && return;
+286 2 $x[46]++;
+287 },
+288
+289 sub
+290 {
+291 4 4 my $x = shift;
+292 4 for my $y (1 .. 2)
+293 {
+294 6 100 my $z = $x || last;
+295 4 $x[47]++;
+296 }
+297 },
+298
+299 sub
+300 {
+301 4 4 my $x = shift;
+302 4 for my $y (1 .. 2)
+303 {
+304 8 100 my $z = $x || next;
+305 4 $x[48]++;
+306 }
+307 },
+308
+309 sub
+310 {
+311 4 4 my $x = shift;
+312 4 for my $y (1 .. 2)
+313 {
+314 10 100 my $z = $x++ || redo;
+315 8 $x[49]++;
+316 }
+317 },
+318
+319 sub
+320 {
+321 4 4 my $x = shift;
+322 4 for my $y (1 .. 2)
+323 {
+324 6 100 my $z = $x || goto GR;
+325 4 $x[50]++;
+326 }
+327 GR:
+328 4 },
+329
+330 sub
+331 {
+332 4 4 my $x = shift;
+333 4 for my $y (1 .. 2)
+334 {
+335 8 100 eval { my $z = $x || die };
+ 8
+336 8 $x[51]++;
+337 }
+338 },
+339 1 );
+340
+341 1 for my $s (@s)
+342 {
+343 10 for my $y (0, 1)
+344 {
+345 20 $s->($y)
+346 }
+347
+348 10 for my $y (1, 0)
+349 {
+350 20 $s->($y)
+351 }
+352 }
+353
+354
+355 1 my ($a, $b) = (0, 1);
+356
+357 *** 1 50 33 if ($a && $b)
*** 50 33
*** 50 50
-295 {
-296 *** 0 print "path 1\n";
-297 }
-298 elsif (!$a && !$b)
-299 {
-300 *** 0 print "path 2\n";
-301 }
-302 elsif ($b || 0)
-303 {
-304 1 print "path 3\n";
-305 *** 1 50 33 if (!$b || $a)
+358 {
+359 *** 0 print "path 1\n";
+360 }
+361 elsif (!$a && !$b)
+362 {
+363 *** 0 print "path 2\n";
+364 }
+365 elsif ($b || 0)
+366 {
+367 1 print "path 3\n";
+368 *** 1 50 33 if (!$b || $a)
*** 50 33
-306 {
-307 *** 0 print "path 4\n";
-308 }
-309 elsif (!$a && $b)
-310 {
-311 1 print "path 5\n";
-312 }
-313 }
+369 {
+370 *** 0 print "path 4\n";
+371 }
+372 elsif (!$a && $b)
+373 {
+374 1 print "path 5\n";
+375 }
+376 }
Branches
@@ -407,16 +471,22 @@ line err % true false branch
249 100 1 2 if $z > 1
260 100 2 2 unless shift @_
266 100 2 2 if shift @_
-294 *** 50 0 1 if ($a and $b) { }
+357 *** 50 0 1 if ($a and $b) { }
*** 50 0 1 elsif (not $a || $b) { }
*** 50 1 0 elsif ($b or 0) { }
-305 *** 50 0 1 if (not $b or $a) { }
+368 *** 50 0 1 if (not $b or $a) { }
*** 50 1 0 elsif (not $a and $b) { }
Conditions
----------
+and 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+285 100 2 2 shift @_ && return
+
and 3 conditions
line err % !l l&&!r l&&r expr
@@ -425,14 +495,20 @@ line err % !l l&&!r l&&r expr
51 *** 33 4 0 0 $y and $z
68 *** 33 4 0 0 $y and $z
*** 33 4 0 0 $y and $z
-294 *** 33 1 0 0 $a and $b
-305 *** 33 0 0 1 not $a and $b
+357 *** 33 1 0 0 $a and $b
+368 *** 33 0 0 1 not $a and $b
or 2 conditions
line err % l !l expr
----- --- ------ ------ ------ ----
-294 *** 50 1 0 $b or 0
+279 100 2 2 shift @_ || return
+294 100 4 2 $x || last
+304 100 4 4 $x || next
+314 100 8 2 $x++ || redo
+324 100 4 2 $x || goto GR
+335 100 4 4 $x || die
+357 *** 50 1 0 $b or 0
or 3 conditions
@@ -440,8 +516,8 @@ line err % l !l&&r !l&&!r expr
----- --- ------ ------ ------ ------ ----
27 *** 66 0 2 2 $y or $z
51 *** 66 0 2 2 $y or $z
-294 *** 33 0 1 0 $a || $b
-305 *** 33 0 0 1 not $b or $a
+357 *** 33 0 1 0 $a || $b
+368 *** 33 0 0 1 not $b or $a
xor 4 conditions
@@ -477,5 +553,12 @@ BEGIN 1 tests/cond_branch:99
__ANON__ 4 tests/cond_branch:260
__ANON__ 4 tests/cond_branch:266
__ANON__ 4 tests/cond_branch:273
+__ANON__ 4 tests/cond_branch:279
+__ANON__ 4 tests/cond_branch:285
+__ANON__ 4 tests/cond_branch:291
+__ANON__ 4 tests/cond_branch:301
+__ANON__ 4 tests/cond_branch:311
+__ANON__ 4 tests/cond_branch:321
+__ANON__ 4 tests/cond_branch:332
@@ -0,0 +1,564 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/cond_branch 90.3 79.3 32.9 100.0 76.2
+Total 90.3 79.3 32.9 100.0 76.2
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/cond_branch
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+ 1
+11 1 1 use warnings;
+ 1
+ 1
+12
+13 1 my @x;
+14
+15 1 for my $y (0, 0)
+16 {
+17 2 for my $z (1, 0)
+18 {
+19 *** 4 50 33 if ($y && $z)
+20 {
+21 *** 0 $x[1]++;
+22 }
+23 else
+24 {
+25 4 $x[2]++;
+26 }
+27 *** 4 100 66 if ($y || $z)
+28 {
+29 2 $x[3]++;
+30 }
+31 else
+32 {
+33 2 $x[4]++;
+34 }
+35
+36 *** 4 50 $y && $x[5]++;
+37 *** 4 50 $x[5]++ if $y;
+38
+39 4 100 $z && $x[6]++;
+40 4 100 $x[6]++ if $z;
+41
+42 *** 4 50 $y || $x[7]++;
+43 *** 4 50 $x[7]++ unless $y;
+44
+45 4 100 $z || $x[8]++;
+46 4 100 $x[8]++ unless $z;
+47
+48 *** 4 50 $y ? $x[9]++ : $x[10]++;
+49 4 100 $z ? $x[11]++ : $x[12]++;
+50
+51 *** 4 50 33 if ($y)
+ *** 50 66
+ 100
+52 {
+53 *** 0 $x[13]++;
+54 }
+55 elsif ($y && $z)
+56 {
+57 *** 0 $x[14]++;
+58 }
+59 elsif ($y || $z)
+60 {
+61 2 $x[15]++;
+62 }
+63 else
+64 {
+65 2 $x[16]++;
+66 }
+67
+68 *** 4 50 33 $y && $z && $x[17]++; $y && $z && $x[18]++;
+ *** 4 50 33
+69 }
+70 }
+71
+72
+73 1 for my $y (0, 1)
+74 {
+75 2 100 $y || next;
+76 1 $x[18]++;
+77 }
+78
+79 1 for my $y (1, 0)
+80 {
+81 2 100 $y || next;
+82 1 $x[19]++;
+83 }
+84
+85 1 for my $y (0, 1)
+86 {
+87 2 100 $y && next;
+88 1 $x[20]++;
+89 }
+90
+91 1 for my $y (1, 0)
+92 {
+93 2 100 $y && next;
+94 1 $x[21]++;
+95 }
+96
+97 1 for my $y (0, 1)
+98 {
+99 1 1 no warnings "void";
+ 1
+ 1
+100 *** 2 0 my $w = $y xor next;
+101 *** 0 $x[22]++;
+102 }
+103
+104 1 for my $y (1, 0)
+105 {
+106 1 1 no warnings "void";
+ 1
+ 1
+107 *** 2 0 my $w = $y xor next;
+108 *** 0 $x[23]++;
+109 }
+110
+111
+112 1 for my $y (0, 1)
+113 {
+114 *** 1 50 $y || last;
+115 *** 0 $x[24]++;
+116 }
+117
+118 1 for my $y (1, 0)
+119 {
+120 2 100 $y || last;
+121 1 $x[25]++;
+122 }
+123
+124 1 for my $y (0, 1)
+125 {
+126 2 100 $y && last;
+127 1 $x[26]++;
+128 }
+129
+130 1 for my $y (1, 0)
+131 {
+132 *** 1 50 $y && last;
+133 *** 0 $x[27]++;
+134 }
+135
+136 1 for my $y (0, 1)
+137 {
+138 1 1 no warnings "void";
+ 1
+ 1
+139 *** 1 0 my $w = $y xor last;
+140 *** 0 $x[28]++;
+141 }
+142
+143 1 for my $y (1, 0)
+144 {
+145 1 1 no warnings "void";
+ 1
+ 1
+146 *** 1 0 my $w = $y xor last;
+147 *** 0 $x[29]++;
+148 }
+149
+150
+151 1 for my $y (0, 1)
+152 {
+153 *** 1 50 $y || goto G1;
+154 *** 0 $x[30]++;
+155 }
+156 G1:
+157
+158 1 for my $y (1, 0)
+159 {
+160 2 100 $y || goto G2;
+161 1 $x[31]++;
+162 }
+163 G2:
+164
+165 1 for my $y (0, 1)
+166 {
+167 2 100 $y && goto G3;
+168 1 $x[32]++;
+169 }
+170 G3:
+171
+172 1 for my $y (1, 0)
+173 {
+174 *** 1 50 $y && goto G4;
+175 *** 0 $x[33]++;
+176 }
+177 G4:
+178
+179 1 for my $y (0, 1)
+180 {
+181 1 1 no warnings "void";
+ 1
+ 1
+182 *** 1 0 my $w = $y xor goto G5;
+183 *** 0 $x[34]++;
+184 }
+185 G5:
+186
+187 1 for my $y (1, 0)
+188 {
+189 1 1 no warnings "void";
+ 1
+ 1
+190 *** 1 0 my $w = $y xor goto G6;
+191 *** 0 $x[35]++;
+192 }
+193 G6:
+194
+195
+196 1 my $z;
+197
+198 1 $z = -1;
+199 1 for my $y (0, 1)
+200 {
+201 3 $z++;
+202 3 100 last if $z > 1;
+203 2 100 $z || redo;
+204 1 $x[36]++;
+205 }
+206
+207 1 $z = -1;
+208 1 for my $y (1, 0)
+209 {
+210 3 $z++;
+211 3 100 last if $z > 1;
+212 2 100 !$z || redo;
+213 1 $x[37]++;
+214 }
+215
+216 1 $z = -1;
+217 1 for my $y (0, 1)
+218 {
+219 3 $z++;
+220 3 100 last if $z > 1;
+221 2 100 $z && redo;
+222 1 $x[38]++;
+223 }
+224
+225 1 $z = -1;
+226 1 for my $y (1, 0)
+227 {
+228 3 $z++;
+229 3 100 last if $z > 1;
+230 2 100 !$z && redo;
+231 1 $x[39]++;
+232 }
+233
+234
+235 1 $z = -1;
+236 1 for my $y (0, 1)
+237 {
+238 3 $z++;
+239 3 100 last if $z > 1;
+240 1 1 no warnings "void";
+ 1
+ 1
+241 *** 2 0 my $w = $z xor redo;
+242 *** 0 $x[40]++;
+243 }
+244
+245 1 $z = -1;
+246 1 for my $y (1, 0)
+247 {
+248 3 $z++;
+249 3 100 last if $z > 1;
+250 1 1 no warnings "void";
+ 1
+ 1
+251 *** 2 0 my $w = !$z xor redo;
+252 *** 0 $x[41]++;
+253 }
+254
+255
+256 my @s =
+257 (
+258 sub
+259 {
+260 4 100 4 shift || return;
+261 2 $x[42]++;
+262 },
+263
+264 sub
+265 {
+266 4 100 4 shift && return;
+267 2 $x[43]++;
+268 },
+269
+270 sub
+271 {
+272 1 1 no warnings "void";
+ 1
+ 1
+273 *** 4 0 4 shift xor return;
+274 *** 0 $x[44]++;
+275 },
+276
+277 sub
+278 {
+279 4 100 4 my $x = shift || return;
+280 2 $x[45]++;
+281 },
+282
+283 sub
+284 {
+285 4 100 4 my $x = shift && return;
+286 2 $x[46]++;
+287 },
+288
+289 sub
+290 {
+291 4 4 my $x = shift;
+292 4 for my $y (1 .. 2)
+293 {
+294 6 100 my $z = $x || last;
+295 4 $x[47]++;
+296 }
+297 },
+298
+299 sub
+300 {
+301 4 4 my $x = shift;
+302 4 for my $y (1 .. 2)
+303 {
+304 8 100 my $z = $x || next;
+305 4 $x[48]++;
+306 }
+307 },
+308
+309 sub
+310 {
+311 4 4 my $x = shift;
+312 4 for my $y (1 .. 2)
+313 {
+314 10 100 my $z = $x++ || redo;
+315 8 $x[49]++;
+316 }
+317 },
+318
+319 sub
+320 {
+321 4 4 my $x = shift;
+322 4 for my $y (1 .. 2)
+323 {
+324 6 100 my $z = $x || goto GR;
+325 4 $x[50]++;
+326 }
+327 GR:
+328 4 },
+329
+330 sub
+331 {
+332 4 4 my $x = shift;
+333 4 for my $y (1 .. 2)
+334 {
+335 8 100 eval { my $z = $x || die };
+ 8
+336 8 $x[51]++;
+337 }
+338 },
+339 1 );
+340
+341 1 for my $s (@s)
+342 {
+343 10 for my $y (0, 1)
+344 {
+345 20 $s->($y)
+346 }
+347
+348 10 for my $y (1, 0)
+349 {
+350 20 $s->($y)
+351 }
+352 }
+353
+354
+355 1 my ($a, $b) = (0, 1);
+356
+357 *** 1 50 33 if ($a && $b)
+ *** 50 33
+ *** 50 50
+358 {
+359 *** 0 print "path 1\n";
+360 }
+361 elsif (!$a && !$b)
+362 {
+363 *** 0 print "path 2\n";
+364 }
+365 elsif ($b || 0)
+366 {
+367 1 print "path 3\n";
+368 *** 1 50 33 if (!$b || $a)
+ *** 50 33
+369 {
+370 *** 0 print "path 4\n";
+371 }
+372 elsif (!$a && $b)
+373 {
+374 1 print "path 5\n";
+375 }
+376 }
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+19 *** 50 0 4 if ($y and $z) { }
+27 100 2 2 if ($y or $z) { }
+36 *** 50 0 4 if $y
+37 *** 50 0 4 if $y
+39 100 2 2 if $z
+40 100 2 2 if $z
+42 *** 50 4 0 unless $y
+43 *** 50 4 0 unless $y
+45 100 2 2 unless $z
+46 100 2 2 unless $z
+48 *** 50 0 4 $y ? :
+49 100 2 2 $z ? :
+51 *** 50 0 4 if ($y) { }
+ *** 50 0 4 elsif ($y and $z) { }
+ 100 2 2 elsif ($y or $z) { }
+68 *** 50 0 4 if $y and $z
+ *** 50 0 4 if $y and $z
+75 100 1 1 unless $y
+81 100 1 1 unless $y
+87 100 1 1 if $y
+93 100 1 1 if $y
+114 *** 50 1 0 unless $y
+120 100 1 1 unless $y
+126 100 1 1 if $y
+132 *** 50 1 0 if $y
+153 *** 50 1 0 unless $y
+160 100 1 1 unless $y
+167 100 1 1 if $y
+174 *** 50 1 0 if $y
+202 100 1 2 if $z > 1
+203 100 1 1 unless $z
+211 100 1 2 if $z > 1
+212 100 1 1 if $z
+220 100 1 2 if $z > 1
+221 100 1 1 if $z
+229 100 1 2 if $z > 1
+230 100 1 1 unless $z
+239 100 1 2 if $z > 1
+249 100 1 2 if $z > 1
+260 100 2 2 unless shift()
+266 100 2 2 if shift()
+357 *** 50 0 1 if ($a and $b) { }
+ *** 50 0 1 elsif (not $a || $b) { }
+ *** 50 1 0 elsif ($b or 0) { }
+368 *** 50 0 1 if (not $b or $a) { }
+ *** 50 1 0 elsif (not $a and $b) { }
+
+
+Conditions
+----------
+
+and 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+285 100 2 2 shift() && return
+
+and 3 conditions
+
+line err % !l l&&!r l&&r expr
+----- --- ------ ------ ------ ------ ----
+19 *** 33 4 0 0 $y and $z
+51 *** 33 4 0 0 $y and $z
+68 *** 33 4 0 0 $y and $z
+ *** 33 4 0 0 $y and $z
+357 *** 33 1 0 0 $a and $b
+368 *** 33 0 0 1 not $a and $b
+
+or 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+279 100 2 2 shift() || return
+294 100 4 2 $x || last
+304 100 4 4 $x || next
+314 100 8 2 $x++ || redo
+324 100 4 2 $x || goto GR
+335 100 4 4 $x || die
+357 *** 50 1 0 $b or 0
+
+or 3 conditions
+
+line err % l !l&&r !l&&!r expr
+----- --- ------ ------ ------ ------ ----
+27 *** 66 0 2 2 $y or $z
+51 *** 66 0 2 2 $y or $z
+357 *** 33 0 1 0 $a || $b
+368 *** 33 0 0 1 not $b or $a
+
+xor 4 conditions
+
+line err % l&&r l&&!r !l&&r !l&&!r expr
+----- --- ------ ------ ------ ------ ------ ----
+100 *** 0 0 0 0 0 my $w = $y xor next
+107 *** 0 0 0 0 0 my $w = $y xor next
+139 *** 0 0 0 0 0 my $w = $y xor last
+146 *** 0 0 0 0 0 my $w = $y xor last
+182 *** 0 0 0 0 0 my $w = $y xor goto G5
+190 *** 0 0 0 0 0 my $w = $y xor goto G6
+241 *** 0 0 0 0 0 my $w = $z xor redo
+251 *** 0 0 0 0 0 my $w = !$z xor redo
+273 *** 0 0 0 0 0 shift() xor return
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ---------------------
+BEGIN 1 tests/cond_branch:10
+BEGIN 1 tests/cond_branch:106
+BEGIN 1 tests/cond_branch:11
+BEGIN 1 tests/cond_branch:138
+BEGIN 1 tests/cond_branch:145
+BEGIN 1 tests/cond_branch:181
+BEGIN 1 tests/cond_branch:189
+BEGIN 1 tests/cond_branch:240
+BEGIN 1 tests/cond_branch:250
+BEGIN 1 tests/cond_branch:272
+BEGIN 1 tests/cond_branch:99
+__ANON__ 4 tests/cond_branch:260
+__ANON__ 4 tests/cond_branch:266
+__ANON__ 4 tests/cond_branch:273
+__ANON__ 4 tests/cond_branch:279
+__ANON__ 4 tests/cond_branch:285
+__ANON__ 4 tests/cond_branch:291
+__ANON__ 4 tests/cond_branch:301
+__ANON__ 4 tests/cond_branch:311
+__ANON__ 4 tests/cond_branch:321
+__ANON__ 4 tests/cond_branch:332
+
+
@@ -0,0 +1,553 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/cond_branch 89.7 79.3 32.9 100.0 75.5
+Total 89.7 79.3 32.9 100.0 75.5
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/cond_branch
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 1 my @x;
+14
+15 1 for my $y (0, 0)
+16 {
+17 2 for my $z (1, 0)
+18 {
+19 *** 4 50 33 if ($y && $z)
+20 {
+21 *** 0 $x[1]++;
+22 }
+23 else
+24 {
+25 4 $x[2]++;
+26 }
+27 *** 4 100 66 if ($y || $z)
+28 {
+29 2 $x[3]++;
+30 }
+31 else
+32 {
+33 2 $x[4]++;
+34 }
+35
+36 *** 4 50 $y && $x[5]++;
+37 *** 4 50 $x[5]++ if $y;
+38
+39 4 100 $z && $x[6]++;
+40 4 100 $x[6]++ if $z;
+41
+42 *** 4 50 $y || $x[7]++;
+43 *** 4 50 $x[7]++ unless $y;
+44
+45 4 100 $z || $x[8]++;
+46 4 100 $x[8]++ unless $z;
+47
+48 *** 4 50 $y ? $x[9]++ : $x[10]++;
+49 4 100 $z ? $x[11]++ : $x[12]++;
+50
+51 *** 4 50 33 if ($y)
+ *** 50 66
+ 100
+52 {
+53 *** 0 $x[13]++;
+54 }
+55 elsif ($y && $z)
+56 {
+57 *** 0 $x[14]++;
+58 }
+59 elsif ($y || $z)
+60 {
+61 2 $x[15]++;
+62 }
+63 else
+64 {
+65 2 $x[16]++;
+66 }
+67
+68 *** 4 50 33 $y && $z && $x[17]++; $y && $z && $x[18]++;
+ *** 4 50 33
+69 }
+70 }
+71
+72
+73 1 for my $y (0, 1)
+74 {
+75 2 100 $y || next;
+76 1 $x[18]++;
+77 }
+78
+79 1 for my $y (1, 0)
+80 {
+81 2 100 $y || next;
+82 1 $x[19]++;
+83 }
+84
+85 1 for my $y (0, 1)
+86 {
+87 2 100 $y && next;
+88 1 $x[20]++;
+89 }
+90
+91 1 for my $y (1, 0)
+92 {
+93 2 100 $y && next;
+94 1 $x[21]++;
+95 }
+96
+97 1 for my $y (0, 1)
+98 {
+99 1 1 no warnings "void";
+ 1
+100 *** 2 0 my $w = $y xor next;
+101 *** 0 $x[22]++;
+102 }
+103
+104 1 for my $y (1, 0)
+105 {
+106 1 1 no warnings "void";
+ 1
+107 *** 2 0 my $w = $y xor next;
+108 *** 0 $x[23]++;
+109 }
+110
+111
+112 1 for my $y (0, 1)
+113 {
+114 *** 1 50 $y || last;
+115 *** 0 $x[24]++;
+116 }
+117
+118 1 for my $y (1, 0)
+119 {
+120 2 100 $y || last;
+121 1 $x[25]++;
+122 }
+123
+124 1 for my $y (0, 1)
+125 {
+126 2 100 $y && last;
+127 1 $x[26]++;
+128 }
+129
+130 1 for my $y (1, 0)
+131 {
+132 *** 1 50 $y && last;
+133 *** 0 $x[27]++;
+134 }
+135
+136 1 for my $y (0, 1)
+137 {
+138 1 1 no warnings "void";
+ 1
+139 *** 1 0 my $w = $y xor last;
+140 *** 0 $x[28]++;
+141 }
+142
+143 1 for my $y (1, 0)
+144 {
+145 1 1 no warnings "void";
+ 1
+146 *** 1 0 my $w = $y xor last;
+147 *** 0 $x[29]++;
+148 }
+149
+150
+151 1 for my $y (0, 1)
+152 {
+153 *** 1 50 $y || goto G1;
+154 *** 0 $x[30]++;
+155 }
+156 G1:
+157
+158 1 for my $y (1, 0)
+159 {
+160 2 100 $y || goto G2;
+161 1 $x[31]++;
+162 }
+163 G2:
+164
+165 1 for my $y (0, 1)
+166 {
+167 2 100 $y && goto G3;
+168 1 $x[32]++;
+169 }
+170 G3:
+171
+172 1 for my $y (1, 0)
+173 {
+174 *** 1 50 $y && goto G4;
+175 *** 0 $x[33]++;
+176 }
+177 G4:
+178
+179 1 for my $y (0, 1)
+180 {
+181 1 1 no warnings "void";
+ 1
+182 *** 1 0 my $w = $y xor goto G5;
+183 *** 0 $x[34]++;
+184 }
+185 G5:
+186
+187 1 for my $y (1, 0)
+188 {
+189 1 1 no warnings "void";
+ 1
+190 *** 1 0 my $w = $y xor goto G6;
+191 *** 0 $x[35]++;
+192 }
+193 G6:
+194
+195
+196 1 my $z;
+197
+198 1 $z = -1;
+199 1 for my $y (0, 1)
+200 {
+201 3 $z++;
+202 3 100 last if $z > 1;
+203 2 100 $z || redo;
+204 1 $x[36]++;
+205 }
+206
+207 1 $z = -1;
+208 1 for my $y (1, 0)
+209 {
+210 3 $z++;
+211 3 100 last if $z > 1;
+212 2 100 !$z || redo;
+213 1 $x[37]++;
+214 }
+215
+216 1 $z = -1;
+217 1 for my $y (0, 1)
+218 {
+219 3 $z++;
+220 3 100 last if $z > 1;
+221 2 100 $z && redo;
+222 1 $x[38]++;
+223 }
+224
+225 1 $z = -1;
+226 1 for my $y (1, 0)
+227 {
+228 3 $z++;
+229 3 100 last if $z > 1;
+230 2 100 !$z && redo;
+231 1 $x[39]++;
+232 }
+233
+234
+235 1 $z = -1;
+236 1 for my $y (0, 1)
+237 {
+238 3 $z++;
+239 3 100 last if $z > 1;
+240 1 1 no warnings "void";
+ 1
+241 *** 2 0 my $w = $z xor redo;
+242 *** 0 $x[40]++;
+243 }
+244
+245 1 $z = -1;
+246 1 for my $y (1, 0)
+247 {
+248 3 $z++;
+249 3 100 last if $z > 1;
+250 1 1 no warnings "void";
+ 1
+251 *** 2 0 my $w = !$z xor redo;
+252 *** 0 $x[41]++;
+253 }
+254
+255
+256 my @s =
+257 (
+258 sub
+259 {
+260 4 100 4 shift || return;
+261 2 $x[42]++;
+262 },
+263
+264 sub
+265 {
+266 4 100 4 shift && return;
+267 2 $x[43]++;
+268 },
+269
+270 sub
+271 {
+272 1 1 no warnings "void";
+ 1
+273 *** 4 0 4 shift xor return;
+274 *** 0 $x[44]++;
+275 },
+276
+277 sub
+278 {
+279 4 100 4 my $x = shift || return;
+280 2 $x[45]++;
+281 },
+282
+283 sub
+284 {
+285 4 100 4 my $x = shift && return;
+286 2 $x[46]++;
+287 },
+288
+289 sub
+290 {
+291 4 4 my $x = shift;
+292 4 for my $y (1 .. 2)
+293 {
+294 6 100 my $z = $x || last;
+295 4 $x[47]++;
+296 }
+297 },
+298
+299 sub
+300 {
+301 4 4 my $x = shift;
+302 4 for my $y (1 .. 2)
+303 {
+304 8 100 my $z = $x || next;
+305 4 $x[48]++;
+306 }
+307 },
+308
+309 sub
+310 {
+311 4 4 my $x = shift;
+312 4 for my $y (1 .. 2)
+313 {
+314 10 100 my $z = $x++ || redo;
+315 8 $x[49]++;
+316 }
+317 },
+318
+319 sub
+320 {
+321 4 4 my $x = shift;
+322 4 for my $y (1 .. 2)
+323 {
+324 6 100 my $z = $x || goto GR;
+325 4 $x[50]++;
+326 }
+327 GR:
+328 4 },
+329
+330 sub
+331 {
+332 4 4 my $x = shift;
+333 4 for my $y (1 .. 2)
+334 {
+335 8 100 eval { my $z = $x || die };
+ 8
+336 8 $x[51]++;
+337 }
+338 },
+339 1 );
+340
+341 1 for my $s (@s)
+342 {
+343 10 for my $y (0, 1)
+344 {
+345 20 $s->($y)
+346 }
+347
+348 10 for my $y (1, 0)
+349 {
+350 20 $s->($y)
+351 }
+352 }
+353
+354
+355 1 my ($a, $b) = (0, 1);
+356
+357 *** 1 50 33 if ($a && $b)
+ *** 50 33
+ *** 50 50
+358 {
+359 *** 0 print "path 1\n";
+360 }
+361 elsif (!$a && !$b)
+362 {
+363 *** 0 print "path 2\n";
+364 }
+365 elsif ($b || 0)
+366 {
+367 1 print "path 3\n";
+368 *** 1 50 33 if (!$b || $a)
+ *** 50 33
+369 {
+370 *** 0 print "path 4\n";
+371 }
+372 elsif (!$a && $b)
+373 {
+374 1 print "path 5\n";
+375 }
+376 }
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+19 *** 50 0 4 if ($y and $z) { }
+27 100 2 2 if ($y or $z) { }
+36 *** 50 0 4 if $y
+37 *** 50 0 4 if $y
+39 100 2 2 if $z
+40 100 2 2 if $z
+42 *** 50 4 0 unless $y
+43 *** 50 4 0 unless $y
+45 100 2 2 unless $z
+46 100 2 2 unless $z
+48 *** 50 0 4 $y ? :
+49 100 2 2 $z ? :
+51 *** 50 0 4 if ($y) { }
+ *** 50 0 4 elsif ($y and $z) { }
+ 100 2 2 elsif ($y or $z) { }
+68 *** 50 0 4 if $y and $z
+ *** 50 0 4 if $y and $z
+75 100 1 1 unless $y
+81 100 1 1 unless $y
+87 100 1 1 if $y
+93 100 1 1 if $y
+114 *** 50 1 0 unless $y
+120 100 1 1 unless $y
+126 100 1 1 if $y
+132 *** 50 1 0 if $y
+153 *** 50 1 0 unless $y
+160 100 1 1 unless $y
+167 100 1 1 if $y
+174 *** 50 1 0 if $y
+202 100 1 2 if $z > 1
+203 100 1 1 unless $z
+211 100 1 2 if $z > 1
+212 100 1 1 if $z
+220 100 1 2 if $z > 1
+221 100 1 1 if $z
+229 100 1 2 if $z > 1
+230 100 1 1 unless $z
+239 100 1 2 if $z > 1
+249 100 1 2 if $z > 1
+260 100 2 2 unless shift()
+266 100 2 2 if shift()
+357 *** 50 0 1 if ($a and $b) { }
+ *** 50 0 1 elsif (not $a || $b) { }
+ *** 50 1 0 elsif ($b or 0) { }
+368 *** 50 0 1 if (not $b or $a) { }
+ *** 50 1 0 elsif (not $a and $b) { }
+
+
+Conditions
+----------
+
+and 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+285 100 2 2 shift() && return
+
+and 3 conditions
+
+line err % !l l&&!r l&&r expr
+----- --- ------ ------ ------ ------ ----
+19 *** 33 4 0 0 $y and $z
+51 *** 33 4 0 0 $y and $z
+68 *** 33 4 0 0 $y and $z
+ *** 33 4 0 0 $y and $z
+357 *** 33 1 0 0 $a and $b
+368 *** 33 0 0 1 not $a and $b
+
+or 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+279 100 2 2 shift() || return
+294 100 4 2 $x || last
+304 100 4 4 $x || next
+314 100 8 2 $x++ || redo
+324 100 4 2 $x || goto GR
+335 100 4 4 $x || die
+357 *** 50 1 0 $b or 0
+
+or 3 conditions
+
+line err % l !l&&r !l&&!r expr
+----- --- ------ ------ ------ ------ ----
+27 *** 66 0 2 2 $y or $z
+51 *** 66 0 2 2 $y or $z
+357 *** 33 0 1 0 $a || $b
+368 *** 33 0 0 1 not $b or $a
+
+xor 4 conditions
+
+line err % l&&r l&&!r !l&&r !l&&!r expr
+----- --- ------ ------ ------ ------ ------ ----
+100 *** 0 0 0 0 0 my $w = $y xor next
+107 *** 0 0 0 0 0 my $w = $y xor next
+139 *** 0 0 0 0 0 my $w = $y xor last
+146 *** 0 0 0 0 0 my $w = $y xor last
+182 *** 0 0 0 0 0 my $w = $y xor goto G5
+190 *** 0 0 0 0 0 my $w = $y xor goto G6
+241 *** 0 0 0 0 0 my $w = $z xor redo
+251 *** 0 0 0 0 0 my $w = !$z xor redo
+273 *** 0 0 0 0 0 shift() xor return
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ---------------------
+BEGIN 1 tests/cond_branch:10
+BEGIN 1 tests/cond_branch:106
+BEGIN 1 tests/cond_branch:11
+BEGIN 1 tests/cond_branch:138
+BEGIN 1 tests/cond_branch:145
+BEGIN 1 tests/cond_branch:181
+BEGIN 1 tests/cond_branch:189
+BEGIN 1 tests/cond_branch:240
+BEGIN 1 tests/cond_branch:250
+BEGIN 1 tests/cond_branch:272
+BEGIN 1 tests/cond_branch:99
+__ANON__ 4 tests/cond_branch:260
+__ANON__ 4 tests/cond_branch:266
+__ANON__ 4 tests/cond_branch:273
+__ANON__ 4 tests/cond_branch:279
+__ANON__ 4 tests/cond_branch:285
+__ANON__ 4 tests/cond_branch:291
+__ANON__ 4 tests/cond_branch:301
+__ANON__ 4 tests/cond_branch:311
+__ANON__ 4 tests/cond_branch:321
+__ANON__ 4 tests/cond_branch:332
+
+
@@ -127,7 +127,7 @@ line err % true false branch
41 *** 50 0 11 unless $y or $x[0]++
45 *** 50 11 0 unless $z
53 *** 50 0 11 if ($z) { }
-87 *** 50 0 11 if exists ->{Deparse error: Can't locate object method "name" via package "B::NULL" (perhaps you forgot to load "B::NULL"?) at /usr/local/pkg/perl/default/perl-5.6.1/lib/5.6.1/i686-linux/B/Deparse.pm line 409.
+87 *** 50 0 11 if exists ->{Deparse error: Can't locate object method "name" via package "B::NULL" (perhaps you forgot to load "B::NULL"?) at /usr/local/pkg/perl/default/perl-5.6.1/lib/5.6.1/x86_64-linux/B/Deparse.pm line 409.
}
@@ -127,7 +127,7 @@ line err % true false branch
41 *** 50 0 11 unless $y or $x[0]++
45 *** 50 11 0 unless $z
53 *** 50 0 11 if ($z) { }
-87 *** 50 0 11 if exists ->{Deparse error: Can't locate object method "name" via package "B::NULL" (perhaps you forgot to load "B::NULL"?) at /usr/local/pkg/perl/default/perl-5.6.2/lib/5.6.2/i686-linux/B/Deparse.pm line 409.
+87 *** 50 0 11 if exists ->{Deparse error: Can't locate object method "name" via package "B::NULL" (perhaps you forgot to load "B::NULL"?) at /usr/local/pkg/perl/default/perl-5.6.2/lib/5.6.2/x86_64-linux/B/Deparse.pm line 409.
}
@@ -0,0 +1,278 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/cond_or 90.2 35.0 72.3 75.0 73.8
+tests/cond_or.pl 100.0 n/a 62.5 100.0 77.9
+Total 93.4 35.0 67.8 85.7 75.3
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/cond_or
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 # __COVER__ skip_test $] < 5.008 || $^O eq "cygwin"
+11 # __COVER__ skip_reason Busted on 5.6 and cygwin
+12
+13 1 1 use strict;
+ 1
+14 1 1 use warnings;
+ 1
+15
+16 1 my @x;
+17
+18 1 my $y = 1;
+19 1 my $z = 0;
+20 1 $::foo = 17;
+21
+22 *** 1 50 if ($] >= 5.009)
+23 {
+24 1 $ENV{PATH} = "/bin";
+25 1 system "pwd";
+26 1 1 use lib "tests";
+ 1
+27 1 my $file = "cond_or.pl";
+28 *** 1 50 unless (my $return = do $file)
+29 {
+30 *** 0 0 die "couldn't parse $file: $@" if $@;
+31 *** 0 0 die "couldn't do $file: $!" unless defined $return;
+32 *** 0 0 die "couldn't run $file" unless $return;
+33 }
+34 }
+35
+36 1 for (0 .. 10)
+37 {
+38 *** 11 50 $y ||
+39 $x[1]++;
+40
+41 *** 11 50 33 $y ||
+42 $x[0]++ ||
+43 $x[1]++;
+44
+45 *** 11 50 $x[2]++
+46 unless $z;
+47
+48 11 for (0 .. 2)
+49 {
+50 33 $x[3]++;
+51 }
+52
+53 *** 11 50 if ($z)
+54 {
+55 *** 0 $x[4]++;
+56 }
+57 else
+58 {
+59 11 $x[5]++;
+60 }
+61
+62 *** 11 33 my $p = $y || $z;
+63 *** 11 33 my $q = $z || $y;
+64 11 100 my $r = $_ || "qqq";
+65 11 100 my $s = $_ || [];
+66 11 my $t = $y | $z;
+67 *** 11 50 my $u = $y || 0;
+68 *** 11 50 my $v = $y || undef;
+69 *** 11 50 my $w = $z || 0;
+70
+71 *** 11 50 $p ||= $y;
+72 *** 11 50 $p ||= $z;
+73 11 100 $x[ 6] ||= $y;
+74 *** 11 50 $x[ 7] ||= $z;
+75 11 100 $x[ 8] ||= 1;
+76 11 100 $x[ 9] ||= {};
+77 11 100 $x[10] ||= \"foo";
+78 11 100 $x[11] ||= \$y;
+79 11 100 $x[12] ||= \*STDIO;
+80 *** 11 100 0 $x[13] ||= sub { 1 };
+ *** 0
+81 11 100 $x[14] ||= *::foo{SCALAR};
+82 *** 11 50 $x[15] ||= *STDIO{IO};
+83 11 100 $x[16] ||= bless {}, "XXX";
+84 11 100 $x[17] ||= <<"EOD";
+85 blah
+86 EOD
+87 *** 11 50 cond_dor(\@x) if exists &cond_dor;
+88 }
+89
+90 # print join(", ", @x), "\n";
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+22 *** 50 1 0 if ($] >= 5.009)
+28 *** 50 0 1 unless (my $return = do $file)
+30 *** 0 0 0 if $@
+31 *** 0 0 0 unless defined $return
+32 *** 0 0 0 unless $return
+38 *** 50 0 11 unless $y
+41 *** 50 0 11 unless $y or $x[0]++
+45 *** 50 11 0 unless $z
+53 *** 50 0 11 if ($z) { }
+87 *** 50 11 0 if exists &cond_dor
+
+
+Conditions
+----------
+
+or 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+64 100 10 1 $_ || 'qqq'
+65 100 10 1 $_ || []
+67 *** 50 11 0 $y || 0
+68 *** 50 11 0 $y || undef
+69 *** 50 0 11 $z || 0
+71 *** 50 11 0 $p ||= $y
+72 *** 50 11 0 $p ||= $z
+73 100 10 1 $x[6] ||= $y
+74 *** 50 0 11 $x[7] ||= $z
+75 100 10 1 $x[8] ||= 1
+76 100 10 1 $x[9] ||= {}
+77 100 10 1 $x[10] ||= \'foo'
+78 100 10 1 $x[11] ||= \$y
+79 100 10 1 $x[12] ||= \*STDIO
+80 100 10 1 $x[13] ||= sub {
+ 1;
+}
+
+81 100 10 1 $x[14] ||= *foo{'SCALAR'}
+82 *** 50 0 11 $x[15] ||= *STDIO{'IO'}
+83 100 10 1 $x[16] ||= bless({}, 'XXX')
+84 100 10 1 $x[17] ||= "blah\n"
+
+or 3 conditions
+
+line err % l !l&&r !l&&!r expr
+----- --- ------ ------ ------ ------ ----
+41 *** 33 11 0 0 $y or $x[0]++
+62 *** 33 11 0 0 $y || $z
+63 *** 33 0 11 0 $z || $y
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ----------------
+BEGIN 1 tests/cond_or:13
+BEGIN 1 tests/cond_or:14
+BEGIN 1 tests/cond_or:26
+
+Uncovered Subroutines
+---------------------
+
+Subroutine Count Location
+---------- ----- ----------------
+__ANON__ 0 tests/cond_or:80
+
+
+tests/cond_or.pl
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 sub cond_dor
+14 {
+15 11 11 my ($x) = @_;
+16
+17 11 100 $x->[18] //= undef;
+18 11 100 $x->[18] //= 0;
+19 *** 11 50 $x->[18] //= 0;
+20 *** 11 50 $x->[18] //= 1;
+21 *** 11 50 $x->[18] //= 1;
+22
+23 11 100 $x->[19] //= 1;
+24 *** 11 50 $x->[19] //= 1;
+25 *** 11 50 $x->[19] //= 0;
+26 *** 11 50 $x->[19] //= undef;
+27 *** 11 50 $x->[19] //= 1;
+28
+29 *** 11 50 $x->[20] = $x->[21] // undef;
+30 *** 11 50 $x->[20] = $x->[21] // 0;
+31 *** 11 50 $x->[20] = $x->[21] // 0;
+32 *** 11 50 $x->[20] = $x->[21] // 1;
+33 *** 11 50 $x->[20] = $x->[21] // 1;
+34
+35 11 100 $x->[22] = $x->[22] // undef;
+36 11 100 $x->[22] = $x->[22] // 0;
+37 *** 11 50 $x->[22] = $x->[22] // 0;
+38 *** 11 50 $x->[22] = $x->[22] // 1;
+39 *** 11 50 $x->[22] = $x->[22] // 1;
+40 }
+41
+42 1;
+
+
+Conditions
+----------
+
+or 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+17 100 10 1 $$x[18] //= undef
+18 100 10 1 $$x[18] //= 0
+19 *** 50 11 0 $$x[18] //= 0
+20 *** 50 11 0 $$x[18] //= 1
+21 *** 50 11 0 $$x[18] //= 1
+23 100 10 1 $$x[19] //= 1
+24 *** 50 11 0 $$x[19] //= 1
+25 *** 50 11 0 $$x[19] //= 0
+26 *** 50 11 0 $$x[19] //= undef
+27 *** 50 11 0 $$x[19] //= 1
+29 *** 50 0 11 $$x[21] // undef
+30 *** 50 0 11 $$x[21] // 0
+31 *** 50 0 11 $$x[21] // 0
+32 *** 50 0 11 $$x[21] // 1
+33 *** 50 0 11 $$x[21] // 1
+35 100 10 1 $$x[22] // undef
+36 100 10 1 $$x[22] // 0
+37 *** 50 11 0 $$x[22] // 0
+38 *** 50 11 0 $$x[22] // 1
+39 *** 50 11 0 $$x[22] // 1
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -------------------
+BEGIN 1 tests/cond_or.pl:10
+BEGIN 1 tests/cond_or.pl:11
+cond_dor 11 tests/cond_or.pl:15
+
+
@@ -0,0 +1,72 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/cond_xor 100.0 n/a 66.7 100.0 85.2
+Total 100.0 n/a 66.7 100.0 85.2
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/cond_xor
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 1 my $i = 1;
+14 1 my $j = 0;
+15
+16 1 for my $y (0, 1, 1, 1)
+17 {
+18 4 for my $z (0, 0, 1)
+19 {
+20 12 my $x = $y ^ $z;
+21 12 100 $x = ($y xor $z);
+22
+23 *** 12 50 my $p = ($i xor $y);
+24 *** 12 50 $p = ($j xor $y);
+25 12 $p ^= $y;
+26 }
+27 }
+
+
+Conditions
+----------
+
+xor 4 conditions
+
+line err % l&&r l&&!r !l&&r !l&&!r expr
+----- --- ------ ------ ------ ------ ------ ----
+21 100 3 6 1 2 $y xor $z
+23 *** 50 9 3 0 0 $i xor $y
+24 *** 50 0 0 9 3 $j xor $y
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -----------------
+BEGIN 1 tests/cond_xor:10
+BEGIN 1 tests/cond_xor:11
+
+
@@ -0,0 +1,69 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/default_param 100.0 n/a 100.0 100.0 100.0
+Total 100.0 n/a 100.0 100.0 100.0
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/default_param
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+ 1
+11 1 1 use warnings;
+ 1
+ 1
+12
+13 sub p
+14 {
+15 2 100 2 my $x = shift || 11;
+16 2 100 my $y = shift || [];
+17 2 100 my $z = shift || {};
+18 }
+19
+20 1 p $_, $_, $_ for 0, 1;
+ 1
+
+
+Conditions
+----------
+
+or 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+15 100 1 1 shift() || 11
+16 100 1 1 shift() || []
+17 100 1 1 shift() || {}
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ----------------------
+BEGIN 1 tests/default_param:10
+BEGIN 1 tests/default_param:11
+p 2 tests/default_param:15
+
+
@@ -0,0 +1,66 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/default_param 100.0 n/a 100.0 100.0 100.0
+Total 100.0 n/a 100.0 100.0 100.0
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/default_param
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 sub p
+14 {
+15 2 100 2 my $x = shift || 11;
+16 2 100 my $y = shift || [];
+17 2 100 my $z = shift || {};
+18 }
+19
+20 1 p $_, $_, $_ for 0, 1;
+
+
+Conditions
+----------
+
+or 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+15 100 1 1 shift() || 11
+16 100 1 1 shift() || []
+17 100 1 1 shift() || {}
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ----------------------
+BEGIN 1 tests/default_param:10
+BEGIN 1 tests/default_param:11
+p 2 tests/default_param:15
+
+
@@ -0,0 +1,62 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/deparse 88.9 n/a n/a 75.0 84.6
+Total 88.9 n/a n/a 75.0 84.6
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/deparse
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl -l
+2
+3 # Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 1 1 use B::Deparse;
+ 1
+14
+15 my $xx = sub
+16 {
+17 *** 0 0 print "xx";
+18 1 };
+19
+20 1 print B::Deparse->new->coderef2text($xx)
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ----------------
+BEGIN 1 tests/deparse:10
+BEGIN 1 tests/deparse:11
+BEGIN 1 tests/deparse:13
+
+Uncovered Subroutines
+---------------------
+
+Subroutine Count Location
+---------- ----- ----------------
+__ANON__ 0 tests/deparse:17
+
+
@@ -0,0 +1,126 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/dynamic_subs 94.3 75.0 n/a 80.0 89.8
+Total 94.3 75.0 n/a 80.0 89.8
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/dynamic_subs
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 *** 0 0 sub unused { 0 }
+11 *** 0 0 sub empty { }
+12
+13 sub gen
+14 {
+15 4 4 my $x = shift;
+16 sub
+17 {
+18 5 5 my $y = shift;
+19 *** 5 50 return $x + $y if $y;
+20 }
+21 4 };
+22
+23 1 my $o = gen(1);
+24 1 my $p = $o->(7);
+25 1 my $q = $o->(8);
+26 1 my $r = gen(1)->(2);
+27 1 my $s = gen(3)->(4);
+28 1 my $t = gen(5)->(6);
+29
+30 1 print "$p, $q, $r, $s, $t\n";
+31
+32 1 for my $func (qw(f1 f2 f3))
+33 {
+34 1 1 no strict "refs";
+ 1
+35 *$func = sub
+36 {
+37 2 2 print "$func\n";
+38 }
+39 3 }
+40
+41 1 f1();
+42 1 f2();
+43
+44 sub AUTOLOAD
+45 {
+46 3 3 my $func = $AUTOLOAD;
+47 3 $func =~ s/^.*:://;
+48 1 1 no strict "refs";
+ 1
+49 3 100 if ($func eq "add")
+50 {
+51 *$func = sub
+52 {
+53 3 3 print "Add!\n";
+54 1 };
+55 }
+56 else
+57 {
+58 *$func = sub
+59 {
+60 2 2 print "$func\n";
+61 2 };
+62 }
+63 3 goto &$func
+64 }
+65
+66 1 add();
+67 1 add();
+68 1 add();
+69 1 qaz();
+70 1 wsx();
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+19 *** 50 5 0 if $y
+49 100 1 2 if ($func eq 'add') { }
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ---------------------
+AUTOLOAD 3 tests/dynamic_subs:46
+BEGIN 1 tests/dynamic_subs:34
+BEGIN 1 tests/dynamic_subs:48
+__ANON__ 5 tests/dynamic_subs:18
+__ANON__ 2 tests/dynamic_subs:37
+__ANON__ 3 tests/dynamic_subs:53
+__ANON__ 2 tests/dynamic_subs:60
+gen 4 tests/dynamic_subs:15
+
+Uncovered Subroutines
+---------------------
+
+Subroutine Count Location
+---------- ----- ---------------------
+empty 0 tests/dynamic_subs:11
+unused 0 tests/dynamic_subs:10
+
+
@@ -0,0 +1,112 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/eval1 95.7 50.0 n/a 85.7 90.6
+Total 95.7 50.0 n/a 85.7 90.6
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/eval1
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 # __COVER__ skip_test $] == 5.010
+11 # __COVER__ skip_reason One test fails only under make test on 5.10.0 unhreaded
+12
+13 1 1 use strict;
+ 1
+14 1 1 use warnings;
+ 1
+15
+16 *** 1 50 1 use lib -d "t" ? "t" : "..";
+ 1
+17
+18 1 my $x;
+19
+20 1 3 eval <<'EOS';
+ 3
+ 3
+21 sub e
+22 {
+23 $x++;
+24 $x
+25 }
+26 EOS
+27
+28 1 2 eval <<'EOS';
+ *** 2 0
+ 2 3
+ *** 0
+ 3
+29 sub f
+30 {
+31 $x++;
+32 $x
+33 }
+34
+35 sub g
+36 {
+37 $x++;
+38 }
+39
+40 sub h
+41 {
+42 $x++;
+43 }
+44 EOS
+45
+46 1 e();
+47 1 e();
+48 1 e();
+49 1 f();
+50 1 f();
+51 1 h();
+52 1 h();
+53 1 h();
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+16 *** 50 1 0 -d 't' ? :
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- --------------
+BEGIN 1 tests/eval1:13
+BEGIN 1 tests/eval1:14
+BEGIN 1 tests/eval1:16
+e 3 tests/eval1:20
+f 2 tests/eval1:28
+h 3 tests/eval1:28
+
+Uncovered Subroutines
+---------------------
+
+Subroutine Count Location
+---------- ----- --------------
+g 0 tests/eval1:28
+
+
@@ -0,0 +1,79 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/eval2 94.1 50.0 50.0 100.0 82.1
+Total 94.1 50.0 50.0 100.0 82.1
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/eval2
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use lib "tests";
+ 1
+11
+12 *** 1 50 $x = shift || 0;
+13 1 print "1 - $x\n";
+14 *** 1 50 if ($x) { eval 'use E2' }
+ *** 0
+15 1 print "3 - $x\n";
+16 *** 1 50 1 if ($x < 4) { eval 'use E3' }
+ 1
+ 1
+ 1
+17 1 print "4 - $x\n";
+18 *** 1 50 1 if ($x < 6) { eval 'use E4' }
+ 1
+ 1
+ 1
+19 1 print "5 - $x\n";
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+14 *** 50 0 1 if ($x)
+16 *** 50 1 0 if ($x < 4)
+18 *** 50 1 0 if ($x < 6)
+
+
+Conditions
+----------
+
+or 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+12 *** 50 0 1 shift @ARGV || 0
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- --------------
+BEGIN 1 tests/eval2:10
+BEGIN 1 tests/eval2:16
+BEGIN 1 tests/eval2:18
+
+
@@ -0,0 +1,80 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/eval3 88.9 50.0 50.0 100.0 79.3
+Total 88.9 50.0 50.0 100.0 79.3
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/eval3
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use lib "tests";
+ 1
+11
+12 *** 1 50 $x = shift || 0;
+13 1 print "1 - $x\n";
+14 *** 1 50 if ($x) { eval 'sub s1 { print "s1\n" }'; s1() }
+ *** 0
+ *** 0
+15 1 print "3 - $x\n";
+16 *** 1 50 1 if ($x < 4) { eval 'sub s2 { print "s2\n" }'; s2() }
+ 1
+ 1
+ 1
+17 1 print "4 - $x\n";
+18 *** 1 50 1 if ($x < 6) { eval 'sub s3 { print "s3\n" }'; s3() }
+ 1
+ 1
+ 1
+19 1 print "5 - $x\n";
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+14 *** 50 0 1 if ($x)
+16 *** 50 1 0 if ($x < 4)
+18 *** 50 1 0 if ($x < 6)
+
+
+Conditions
+----------
+
+or 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+12 *** 50 0 1 shift @ARGV || 0
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- --------------
+BEGIN 1 tests/eval3:10
+s2 1 tests/eval3:16
+s3 1 tests/eval3:18
+
+
@@ -0,0 +1,98 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/eval3 100.0 100.0 100.0 100.0 100.0
+Total 100.0 100.0 100.0 100.0 100.0
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/eval3
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 4 4 use lib "tests";
+ 4
+11
+12 4 100 $x = shift || 0;
+13 4 print "1 - $x\n";
+14 4 100 3 if ($x) { eval 'sub s1 { print "s1\n" }'; s1() }
+ 3
+ 3
+ 3
+15 4 print "3 - $x\n";
+16 4 100 if ($x < 4) { eval 'sub s2 { print "s2\n" }'; s2() }
+ 1
+ 1
+17 4 print "4 - $x\n";
+18 4 100 4 if ($x < 6) { eval 'sub s3 { print "s3\n" }'; s3() }
+ 3
+ 3
+ 4
+19 4 print "5 - $x\n";
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+14 100 3 1 if ($x)
+16 100 1 3 if ($x < 4)
+18 100 3 1 if ($x < 6)
+
+
+Conditions
+----------
+
+or 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+12 100 3 1 shift @ARGV || 0
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- --------------
+BEGIN 4 tests/eval3:10
+s1 3 tests/eval3:14
+s3 4 tests/eval3:18
+
+
@@ -0,0 +1,100 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/eval2 100.0 100.0 100.0 100.0 100.0
+Total 100.0 100.0 100.0 100.0 100.0
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/eval2
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 4 4 use lib "tests";
+ 4
+11
+12 4 100 $x = shift || 0;
+13 4 print "1 - $x\n";
+14 4 100 2 if ($x) { eval 'use E2' }
+ 2
+ 2
+ 2
+15 4 print "3 - $x\n";
+16 4 100 2 if ($x < 4) { eval 'use E3' }
+ 2
+ 2
+ 2
+17 4 print "4 - $x\n";
+18 4 100 3 if ($x < 6) { eval 'use E4' }
+ 3
+ 3
+ 3
+19 4 print "5 - $x\n";
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+14 100 2 2 if ($x)
+16 100 2 2 if ($x < 4)
+18 100 3 1 if ($x < 6)
+
+
+Conditions
+----------
+
+or 2 conditions
+
+line err % l !l expr
+----- --- ------ ------ ------ ----
+12 100 2 2 shift @ARGV || 0
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- --------------
+BEGIN 4 tests/eval2:10
+BEGIN 2 tests/eval2:14
+BEGIN 2 tests/eval2:16
+BEGIN 3 tests/eval2:18
+
+
@@ -0,0 +1,91 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/if 83.3 50.0 n/a 100.0 73.3
+Total 83.3 50.0 n/a 100.0 73.3
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/if
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 1 my ($x, $p, $q, $r, $s);
+14
+15 1 $x = 0;
+16
+17 *** 1 50 if ($x)
+18 {
+19 *** 0 $p++
+20 }
+21
+22 *** 1 50 unless ($x)
+23 {
+24 1 $q++
+25 }
+26
+27 1 $x = 1;
+28
+29 *** 1 50 if ($x)
+30 {
+31 1 $r++
+32 }
+33
+34 *** 1 50 if ($x)
+35 {
+36 1 $r++
+37 }
+38 else
+39 {
+40 *** 0 $s++
+41 }
+42
+43 *** 1 50 unless ($x)
+44 {
+45 *** 0 $s++
+46 }
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+17 *** 50 0 1 if ($x)
+22 *** 50 1 0 unless ($x)
+29 *** 50 1 0 if ($x)
+34 *** 50 1 0 if ($x) { }
+43 *** 50 0 1 unless ($x)
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -----------
+BEGIN 1 tests/if:10
+BEGIN 1 tests/if:11
+
+
@@ -0,0 +1,64 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/inc_sub 100.0 75.0 n/a 100.0 94.1
+Total 100.0 75.0 n/a 100.0 94.1
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/inc_sub
+
+line err stmt bran cond sub code
+1 #!/bin/perl
+2
+3 1 1 use lib ();
+ 1
+4
+5 BEGIN
+6 {
+7 lib->import
+8 (
+9 sub
+10 {
+11 3 100 return unless $_[1] eq "IncSub.pm";
+12 1 my $fh;
+13 *** 1 50 open $fh, "tests/IncSub.pm" or die $!;
+14 1 $fh
+15 }
+16 )
+17 1 1 }
+18
+19 1 1 use IncSub;
+ 1
+20
+21 1 IncSub::check
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+11 100 2 1 unless $_[1] eq 'IncSub.pm'
+13 *** 50 0 1 unless open $fh, 'tests/IncSub.pm'
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ----------------
+BEGIN 1 tests/inc_sub:17
+BEGIN 1 tests/inc_sub:19
+BEGIN 1 tests/inc_sub:3
+
+
@@ -0,0 +1,145 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/Module1.pm 25.0 n/a n/a 25.0 25.0
+tests/module1 93.3 50.0 n/a 100.0 90.9
+Total 69.6 50.0 n/a 66.7 67.6
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/Module1.pm
+
+line err stmt bran cond sub code
+1 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+2
+3 # This software is free. It is licensed under the same terms as Perl itself.
+4
+5 # The latest version of this software should be available from my homepage:
+6 # http://www.pjcj.net
+7
+8 package Module1;
+9
+10 my $y = 7;
+11 $y++;
+12
+13 sub _aa
+14 {
+15 *** 0 0 $y++;
+16 *** 0 die;
+17 *** 0 die;
+18 }
+19
+20 sub xx
+21 {
+22 *** 0 0 $y++;
+23 *** 0 die;
+24 }
+25
+26 sub yy
+27 {
+28 *** 0 0 $y++;
+29 }
+30
+31 sub zz
+32 {
+33 11 11 my $x = shift;
+34 11 $x++;
+35 }
+36
+37 1
+38
+39 __END__
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -------------------
+zz 11 tests/Module1.pm:33
+
+Uncovered Subroutines
+---------------------
+
+Subroutine Count Location
+---------- ----- -------------------
+_aa 0 tests/Module1.pm:15
+xx 0 tests/Module1.pm:22
+yy 0 tests/Module1.pm:28
+
+
+tests/module1
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 # __COVER__ changes s/56.3/56.2/
+11
+12 1 1 use strict;
+ 1
+13 1 1 use warnings;
+ 1
+14
+15 1 1 use lib "tests";
+ 1
+16
+17 1 1 use Module1;
+ 1
+18
+19 1 my @x;
+20
+21 sub xx
+22 {
+23 11 11 $x[shift]++;
+24 11 Module1::zz(0);
+25 }
+26
+27 1 for (0 .. 10)
+28 {
+29 *** 11 50 if (time)
+30 {
+31 11 xx(0);
+32 }
+33 else
+34 {
+35 *** 0 $x[1]++;
+36 }
+37 }
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+29 *** 50 11 0 if (time) { }
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ----------------
+BEGIN 1 tests/module1:12
+BEGIN 1 tests/module1:13
+BEGIN 1 tests/module1:15
+BEGIN 1 tests/module1:17
+xx 11 tests/module1:23
+
+
@@ -0,0 +1,145 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/Module2.pm 25.0 n/a n/a 25.0 25.0
+tests/module2 93.3 50.0 n/a 100.0 90.9
+Total 69.6 50.0 n/a 66.7 67.6
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/Module2.pm
+
+line err stmt bran cond sub code
+1 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+2
+3 # This software is free. It is licensed under the same terms as Perl itself.
+4
+5 # The latest version of this software should be available from my homepage:
+6 # http://www.pjcj.net
+7
+8 package NotModule2;
+9
+10 my $y = 7;
+11 $y++;
+12
+13 sub _aa
+14 {
+15 *** 0 0 $y++;
+16 *** 0 die;
+17 *** 0 die;
+18 }
+19
+20 sub _xx
+21 {
+22 *** 0 0 $y++;
+23 *** 0 die;
+24 }
+25
+26 sub yy
+27 {
+28 *** 0 0 $y++;
+29 }
+30
+31 sub zz
+32 {
+33 11 11 my $x = shift;
+34 11 $x++;
+35 }
+36
+37 1
+38
+39 __END__
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -------------------
+zz 11 tests/Module2.pm:33
+
+Uncovered Subroutines
+---------------------
+
+Subroutine Count Location
+---------- ----- -------------------
+_aa 0 tests/Module2.pm:15
+_xx 0 tests/Module2.pm:22
+yy 0 tests/Module2.pm:28
+
+
+tests/module2
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 # __COVER__ changes s/56.3/56.2/
+11
+12 1 1 use strict;
+ 1
+13 1 1 use warnings;
+ 1
+14
+15 1 1 use lib "tests";
+ 1
+16
+17 1 1 use Module2;
+ 1
+18
+19 1 my @x;
+20
+21 sub xx
+22 {
+23 11 11 $x[shift]++;
+24 11 NotModule2::zz(0);
+25 }
+26
+27 1 for (0 .. 10)
+28 {
+29 *** 11 50 if (time)
+30 {
+31 11 xx(0);
+32 }
+33 else
+34 {
+35 *** 0 $x[1]++;
+36 }
+37 }
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+29 *** 50 11 0 if (time) { }
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ----------------
+BEGIN 1 tests/module2:12
+BEGIN 1 tests/module2:13
+BEGIN 1 tests/module2:15
+BEGIN 1 tests/module2:17
+xx 11 tests/module2:23
+
+
@@ -0,0 +1,76 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/module_ignore 100.0 100.0 n/a 100.0 100.0
+Total 100.0 100.0 n/a 100.0 100.0
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/module_ignore
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2006-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 # __COVER__ ignore Module1
+11
+12 1 1 use strict;
+ 1
+13 1 1 use warnings;
+ 1
+14
+15 1 1 use lib "tests";
+ 1
+16
+17 1 1 use Module1;
+ 1
+18
+19 1 my @x;
+20
+21 1 for (0 .. 10)
+22 {
+23 11 100 if (Module1::zz($_))
+24 {
+25 10 $x[0]++;
+26 }
+27 else
+28 {
+29 1 $x[1]++;
+30 }
+31 }
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+23 100 10 1 if (Module1::zz($_)) { }
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ----------------------
+BEGIN 1 tests/module_ignore:12
+BEGIN 1 tests/module_ignore:13
+BEGIN 1 tests/module_ignore:15
+BEGIN 1 tests/module_ignore:17
+
+
@@ -0,0 +1,73 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/Module_import.pm 100.0 n/a n/a 100.0 100.0
+tests/module_import 100.0 n/a n/a 100.0 100.0
+Total 100.0 n/a n/a 100.0 100.0
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/Module_import.pm
+
+line err stmt bran cond sub code
+1 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+2
+3 # This software is free. It is licensed under the same terms as Perl itself.
+4
+5 # The latest version of this software should be available from my homepage:
+6 # http://www.pjcj.net
+7
+8 package Module_import;
+9
+10 sub import
+11 {
+12 1 1 print "Module_import\n";
+13 }
+14
+15 1
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -------------------------
+import 1 tests/Module_import.pm:12
+
+
+tests/module_import
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 BEGIN { push @INC, "tests" }
+11
+12 1 1 use Module_import;
+ 1
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ----------------------
+BEGIN 1 tests/module_import:10
+BEGIN 1 tests/module_import:12
+
+
@@ -0,0 +1,81 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/Module_import.pm 100.0 n/a n/a 100.0 100.0
+tests/module_relative 100.0 n/a n/a 100.0 100.0
+Total 100.0 n/a n/a 100.0 100.0
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/Module_import.pm
+
+line err stmt bran cond sub code
+1 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+2
+3 # This software is free. It is licensed under the same terms as Perl itself.
+4
+5 # The latest version of this software should be available from my homepage:
+6 # http://www.pjcj.net
+7
+8 package Module_import;
+9
+10 sub import
+11 {
+12 1 1 print "Module_import\n";
+13 }
+14
+15 1
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -------------------------
+import 1 tests/Module_import.pm:12
+
+
+tests/module_relative
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 # __COVER__ skip_test $] < 5.008 || $^O eq "cygwin"
+11 # __COVER__ skip_reason Busted on 5.6 and cygwin
+12
+13 1 1 BEGIN { chdir "tests/random/dir" }
+14 1 1 use lib "../..";
+ 1
+15 1 1 use strict;
+ 1
+16 1 1 use Module_import;
+ 1
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ------------------------
+BEGIN 1 tests/module_relative:13
+BEGIN 1 tests/module_relative:14
+BEGIN 1 tests/module_relative:15
+BEGIN 1 tests/module_relative:16
+
+
@@ -0,0 +1,72 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/overload_bool 55.6 50.0 n/a 25.0 46.7
+Total 55.6 50.0 n/a 25.0 46.7
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/overload_bool
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2006-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 package Foo;
+11 use overload
+12 *** 0 0 '""' => sub { shift->render},
+13 1 1 bool => sub { die; 1 };
+ *** 1 0
+ *** 0
+ *** 0
+14
+15 sub render {
+16 *** 0 0 "foo";
+17 }
+18
+19 1 my $foo = 1;
+20 *** 1 50 bless {}, 'Foo' if $foo;
+21
+22 1 1;
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+20 *** 50 1 0 if $foo
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ----------------------
+BEGIN 1 tests/overload_bool:13
+
+Uncovered Subroutines
+---------------------
+
+Subroutine Count Location
+---------- ----- ----------------------
+__ANON__ 0 tests/overload_bool:12
+__ANON__ 0 tests/overload_bool:13
+render 0 tests/overload_bool:16
+
+
@@ -0,0 +1,66 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/overloaded 100.0 50.0 n/a 100.0 93.3
+Total 100.0 50.0 n/a 100.0 93.3
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/overloaded
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2003-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 # Example stolen from overload documentation
+11
+12 package two_face;
+13
+14 1 1 sub new { my $p = shift; bless [@_], $p }
+ 1
+15 1 1 use overload '""' => \&str, '0+' => \&num, fallback => 1;
+ 1
+16 2 2 sub num {shift->[1]}
+17 2 2 sub str {shift->[0]}
+18
+19 package main;
+20
+21 1 my $seven = new two_face ("vii", 7);
+22 1 printf "seven=$seven, seven=%d, eight=%d\n", $seven, $seven+1;
+23 *** 1 50 print "seven contains `i'\n" if $seven =~ /i/;
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+23 *** 50 1 0 if $seven =~ /i/
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -------------------
+BEGIN 1 tests/overloaded:15
+new 1 tests/overloaded:14
+num 2 tests/overloaded:16
+str 2 tests/overloaded:17
+
+
@@ -0,0 +1,53 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/require 100.0 50.0 n/a 100.0 88.9
+Total 100.0 50.0 n/a 100.0 88.9
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/require
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 *** 1 50 1 use lib -d "t" ? "." : "..";
+ 1
+11 1 1 use File::Spec;
+ 1
+12 1 require File::Spec->catfile("tests", "E2.pm");
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+10 *** 50 1 0 -d 't' ? :
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- ----------------
+BEGIN 1 tests/require:10
+BEGIN 1 tests/require:11
+
+
@@ -0,0 +1,103 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/sort 95.7 n/a n/a 85.7 93.3
+Total 95.7 n/a n/a 85.7 93.3
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/sort
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl -w
+2
+3 1 1 use strict;
+ 1
+4
+5 1 my %sort =
+6 (
+7 B => \&backwards,
+8 F => \&forwards
+9 );
+10
+11 sub backwards
+12 {
+13 6 6 return $b cmp $a;
+14 }
+15
+16 sub forwards
+17 {
+18 *** 0 0 return $a cmp $b;
+19 }
+20
+21 sub GetAlgorithm
+22 {
+23 1 1 my ($alg) = @_;
+24 1 return $sort{$alg};
+25 }
+26
+27 1 my @list = qw( a d e c g );
+28
+29 # my $alg = GetAlgorithm(('B', 'F')[int(rand(2))]);
+30 1 my $alg = GetAlgorithm(('B', 'F')[0]);
+31
+32 1 @list = sort {&{$alg}} @list;
+ 6
+ 6
+33
+34 1 1 use Data::Dumper;
+ 1
+35
+36 1 print STDERR Dumper(\@list);
+37
+38 package Failure;
+39
+40 sub fail
+41 {
+42 1 1 my @x = 1 .. 5;
+43 1 my @y = sort { Failure->xyz( $a, $b ) } @x;
+ 8
+44 }
+45
+46 sub xyz
+47 {
+48 8 8 my $self = shift;
+49 8 my ($a, $b) = @_;
+50 8 $a <=> $b;
+51 }
+52 package main;
+53
+54 1 my @l = Failure->fail;
+55
+56 1 print STDERR Dumper(\@l);
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+------------ ----- -------------
+BEGIN 1 tests/sort:3
+BEGIN 1 tests/sort:34
+GetAlgorithm 1 tests/sort:23
+backwards 6 tests/sort:13
+fail 1 tests/sort:42
+xyz 8 tests/sort:48
+
+Uncovered Subroutines
+---------------------
+
+Subroutine Count Location
+------------ ----- -------------
+forwards 0 tests/sort:18
+
+
@@ -0,0 +1,72 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/special_blocks 100.0 n/a n/a 100.0 100.0
+Total 100.0 n/a n/a 100.0 100.0
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/special_blocks
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 1 my $x;
+14
+15 BEGIN
+16 {
+17 1 1 $x++
+18 }
+19
+20 CHECK
+21 {
+22 1 1 $x++
+23 }
+24
+25 INIT
+26 {
+27 1 1 $x++
+28 }
+29
+30 END
+31 {
+32 1 1 $x++
+33 }
+34
+35 1 $x++;
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -----------------------
+BEGIN 1 tests/special_blocks:10
+BEGIN 1 tests/special_blocks:11
+BEGIN 1 tests/special_blocks:17
+CHECK 1 tests/special_blocks:22
+END 1 tests/special_blocks:32
+INIT 1 tests/special_blocks:27
+
+
@@ -0,0 +1,98 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/t0 93.3 62.5 66.7 100.0 82.1
+Total 93.3 62.5 66.7 100.0 82.1
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/t0
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 1 my @x;
+14
+15 1 my $y = 1;
+16
+17 1 for (0 .. 10)
+18 {
+19 *** 11 50 $y &&
+20 $x[1]++;
+21
+22 *** 11 100 66 $y &&
+23 $x[0]++ &&
+24 $x[1]++;
+25
+26 *** 11 50 $x[2]++
+27 if $y;
+28
+29 11 for (0 .. 2)
+30 {
+31 33 $x[3]++;
+32 }
+33
+34 *** 11 50 if ($y)
+35 {
+36 11 $x[4]++;
+37 }
+38 else
+39 {
+40 *** 0 $x[5]++;
+41 }
+42 }
+43
+44 # print join(", ", @x), "\n";
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+19 *** 50 11 0 if $y
+22 100 10 1 if $y and $x[0]++
+26 *** 50 11 0 if $y
+34 *** 50 11 0 if ($y) { }
+
+
+Conditions
+----------
+
+and 3 conditions
+
+line err % !l l&&!r l&&r expr
+----- --- ------ ------ ------ ------ ----
+22 *** 66 0 1 10 $y and $x[0]++
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -----------
+BEGIN 1 tests/t0:10
+BEGIN 1 tests/t0:11
+
+
@@ -0,0 +1,54 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/t1 100.0 n/a n/a 100.0 100.0
+Total 100.0 n/a n/a 100.0 100.0
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/t1
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 1 my @x;
+14
+15 sub xx
+16 {
+17 1 1 $x[shift]++;
+18 }
+19
+20 1 xx(4);
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -----------
+BEGIN 1 tests/t1:10
+BEGIN 1 tests/t1:11
+xx 1 tests/t1:17
+
+
@@ -0,0 +1,85 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/t2 92.9 50.0 n/a 100.0 82.6
+Total 92.9 50.0 n/a 100.0 82.6
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/t2
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 use strict;
+ 1
+11 1 1 use warnings;
+ 1
+12
+13 1 my @x;
+14
+15 sub xx
+16 {
+17 11 11 $x[shift]++;
+18 }
+19
+20 1 for (0 .. 10)
+21 {
+22 time &&
+23 *** 11 50 $x[1]++;
+24
+25 *** 11 50 $x[2]++
+26 if time;
+27
+28 11 for (0 .. 2)
+29 {
+30 33 $x[3]++;
+31 }
+32
+33 *** 11 50 if (time)
+34 {
+35 11 xx(4);
+36 }
+37 else
+38 {
+39 *** 0 $x[5]++;
+40 }
+41 }
+
+
+Branches
+--------
+
+line err % true false branch
+----- --- ------ ------ ------ ------
+23 *** 50 11 0 if time
+25 *** 50 11 0 if time
+33 *** 50 11 0 if (time) { }
+
+
+Covered Subroutines
+-------------------
+
+Subroutine Count Location
+---------- ----- -----------
+BEGIN 1 tests/t2:10
+BEGIN 1 tests/t2:11
+xx 11 tests/t2:17
+
+
@@ -12,8 +12,8 @@ use warnings;
use File::Copy;
-use Devel::Cover::Inc 0.68;
-use Devel::Cover::Test 0.68;
+use Devel::Cover::Inc 0.72;
+use Devel::Cover::Test 0.72;
my $base = $Devel::Cover::Inc::Base;
diff --git a/var/tmp/source/PJCJ/Devel-Cover-0.68/Devel-Cover-0.68/tests/cond_and b/var/tmp/source/PJCJ/Devel-Cover-0.72/Devel-Cover-0.72/tests/cond_and
old mode 100755
new mode 100644
@@ -273,6 +273,69 @@ my @s =
shift xor return;
$x[44]++;
},
+
+ sub
+ {
+ my $x = shift || return;
+ $x[45]++;
+ },
+
+ sub
+ {
+ my $x = shift && return;
+ $x[46]++;
+ },
+
+ sub
+ {
+ my $x = shift;
+ for my $y (1 .. 2)
+ {
+ my $z = $x || last;
+ $x[47]++;
+ }
+ },
+
+ sub
+ {
+ my $x = shift;
+ for my $y (1 .. 2)
+ {
+ my $z = $x || next;
+ $x[48]++;
+ }
+ },
+
+ sub
+ {
+ my $x = shift;
+ for my $y (1 .. 2)
+ {
+ my $z = $x++ || redo;
+ $x[49]++;
+ }
+ },
+
+ sub
+ {
+ my $x = shift;
+ for my $y (1 .. 2)
+ {
+ my $z = $x || goto GR;
+ $x[50]++;
+ }
+GR:
+ },
+
+ sub
+ {
+ my $x = shift;
+ for my $y (1 .. 2)
+ {
+ eval { my $z = $x || die };
+ $x[51]++;
+ }
+ },
);
for my $s (@s)
diff --git a/var/tmp/source/PJCJ/Devel-Cover-0.68/Devel-Cover-0.68/tests/eval1 b/var/tmp/source/PJCJ/Devel-Cover-0.72/Devel-Cover-0.72/tests/eval1
old mode 100755
new mode 100644
@@ -10,7 +10,7 @@
use strict;
use warnings;
-use Devel::Cover::Test 0.68;
+use Devel::Cover::Test 0.72;
my $run_test = sub
{
@@ -10,7 +10,7 @@
use strict;
use warnings;
-use Devel::Cover::Test 0.68;
+use Devel::Cover::Test 0.72;
my $run_test = sub
{
@@ -12,8 +12,8 @@ use warnings;
use File::Copy;
-use Devel::Cover::Inc 0.68;
-use Devel::Cover::Test 0.68;
+use Devel::Cover::Inc 0.72;
+use Devel::Cover::Test 0.72;
my $base = $Devel::Cover::Inc::Base;
diff --git a/var/tmp/source/PJCJ/Devel-Cover-0.68/Devel-Cover-0.68/tests/module1 b/var/tmp/source/PJCJ/Devel-Cover-0.72/Devel-Cover-0.72/tests/module1
old mode 100755
new mode 100644
diff --git a/var/tmp/source/PJCJ/Devel-Cover-0.68/Devel-Cover-0.68/tests/module2 b/var/tmp/source/PJCJ/Devel-Cover-0.72/Devel-Cover-0.72/tests/module2
old mode 100755
new mode 100644
diff --git a/var/tmp/source/PJCJ/Devel-Cover-0.68/Devel-Cover-0.68/tests/t0 b/var/tmp/source/PJCJ/Devel-Cover-0.72/Devel-Cover-0.72/tests/t0
old mode 100755
new mode 100644
diff --git a/var/tmp/source/PJCJ/Devel-Cover-0.68/Devel-Cover-0.68/tests/t1 b/var/tmp/source/PJCJ/Devel-Cover-0.72/Devel-Cover-0.72/tests/t1
old mode 100755
new mode 100644
diff --git a/var/tmp/source/PJCJ/Devel-Cover-0.68/Devel-Cover-0.68/tests/t2 b/var/tmp/source/PJCJ/Devel-Cover-0.72/Devel-Cover-0.72/tests/t2
old mode 100755
new mode 100644
@@ -0,0 +1,91 @@
+# Copyright 2010, Paul Johnson (pjcj@cpan.org)
+
+# This software is free. It is licensed under the same terms as Perl itself.
+
+# The latest version of this software should be available from my homepage:
+# http://www.pjcj.net
+
+package Devel::Cover::BuildUtils;
+
+use strict;
+use warnings;
+
+our $VERSION = "0.72";
+
+use Exporter;
+
+our @ISA = "Exporter";
+our @EXPORT_OK = qw(find_prove cpus prove_command);
+
+sub find_prove
+{
+ my $perl = $^X;
+ unless (-x $perl)
+ {
+ my ($dir) = grep -x "$_/$perl", split /:/, $ENV{PATH};
+ $perl = "$dir/$perl";
+ }
+
+ eval { $perl = readlink($perl) || $perl };
+ # print "perl is [$perl]\n";
+ my ($dir) = $perl =~ m|(.*)/[^/]+|;
+ my ($prove) = grep -x, <$dir/prove*>;
+
+ warn "prove cannot be found in $dir\n";
+
+ $prove
+}
+
+sub cpus
+{
+ my $cpus = 1;
+ eval { chomp ($cpus = `grep -c processor /proc/cpuinfo`); };
+ $cpus
+}
+
+sub prove_command
+{
+ my $prove = find_prove or return;
+ my $cpus = cpus;
+ $cpus-- if $cpus > 4;
+ "$prove -brj$cpus t"
+}
+
+__END__
+
+=head1 NAME
+
+Devel::Cover::BuildUtils - Build utility functions for Devel::Cover
+
+=head1 SYNOPSIS
+
+ use Devel::Cover::BuildUtils "find_prove";
+
+=head1 DESCRIPTION
+
+Build utility functions for Devel::Cover.
+
+=head1 SEE ALSO
+
+ Devel::Cover
+
+=head1 METHODS
+
+=head1 BUGS
+
+Huh?
+
+=head1 VERSION
+
+Version 0.72 - 27th September 2010
+
+=head1 LICENCE
+
+Copyright 2001-2010, Paul Johnson (pjcj@cpan.org)
+
+This software is free. It is licensed under the same terms as Perl itself.
+
+The latest version of this software should be available from my homepage:
+http://www.pjcj.net
+
+=cut
@@ -0,0 +1,76 @@
+#!/usr/bin/perl
+
+# Copyright 2004-2010, Paul Johnson (pjcj@cpan.org)
+
+# This software is free. It is licensed under the same terms as Perl itself.
+
+# The latest version of this software should be available from my homepage:
+# http://www.pjcj.net
+
+use strict;
+use warnings;
+
+use lib "utils";
+
+use Getopt::Long;
+
+use Devel::Cover::BuildUtils "prove_command";
+
+my $Options =
+{
+ dry_run => 0,
+ ignore_failure => 0,
+ silent => 1,
+ version => [],
+};
+
+my $Silent = "";
+
+sub get_options
+{
+ die "Bad option" unless
+ GetOptions($Options, # Store the options in the Options hash.
+ qw(
+ dry_run!
+ ignore_failure!
+ silent!
+ version=s
+ ));
+ $Options->{version} =
+ [ map { ($_, "$_-thr") }
+ qw( 5.6.1 5.6.2
+ 5.8.0 5.8.1 5.8.2 5.8.3 5.8.4 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9
+ 5.10.0 5.10.1 5.11.0 5.12.0 5.12.1 5.12.2
+ 5.13.0 5.13.1 5.13.2 5.13.3 5.13.4 5.13.5 ) ]
+ unless @{$Options->{version}};
+ $Silent = " >/dev/null 2>&1" if $Options->{silent};
+ $Options->{version} =
+ [ grep eval { !system "perl$_ -v$Silent" }, @{$Options->{version}} ];
+ print "Testing against: @{$Options->{version}}\n";
+}
+
+sub sys
+{
+ my ($command, $user) = @_;
+ print "$command\n";
+ return if $Options->{dry_run};
+ $command .= $Silent if $Options->{silent} && !$user;
+ my $ret = system $command;
+ die "command failed: $?" if $ret && !$Options->{ignore_failure};
+}
+
+get_options;
+my $command = "@ARGV" or die "Usage: $0 [-v version] command\n";
+
+for my $v (@{$Options->{version}})
+{
+ my $perl = "perl$v";
+ (my $c = $command) =~ s/=perl/$perl/g;
+ $c =~ s/=v/$v/g;
+ sys "rm -rf t/e2e";
+ sys "$perl Makefile.PL";
+ sys "make clean";
+ sys "$perl Makefile.PL";
+ sys "make";
+ sys $c, 1;
+}
@@ -0,0 +1,52 @@
+#!/usr/bin/perl
+
+# Copyright 2002-2010, Paul Johnson (pjcj@cpan.org)
+
+# This software is free. It is licensed under the same terms as Perl itself.
+
+# The latest version of this software should be available from my homepage:
+# http://www.pjcj.net
+
+require 5.6.1;
+
+use strict;
+use warnings;
+
+our $VERSION = "0.72";
+
+use blib;
+
+use Config;
+exit if $Config{useithreads};
+
+use Devel::Cover::Test 0.72;
+
+my @tests = @ARGV;
+
+mkdir "test_output" unless -d "test_output";
+mkdir "test_output/cover" unless -d "test_output/cover";
+
+unless (@tests)
+{
+ opendir D, "tests" or die "Cannot opendir tests: $!";
+ for my $t (sort readdir D)
+ {
+ next unless -f "tests/$t";
+ next if $t =~ /\.(pm|pl|uncoverable|version|org|bak)$/;
+ next if $t =~ /~$/;
+
+ push @tests, $t;
+ }
+ closedir D or die "Cannot closedir tests: $!";
+}
+
+for my $test (@tests)
+{
+ my $d = "t/e2e";
+ my $t = -e "$d/$test" ? "$d/$test" :
+ -e "$d/a$test.t" ? "$d/a$test.t" :
+ $test;
+ print STDERR "creating golden results for $test\n";
+ require $t or die "Can't require $t: $!";
+ Devel::Cover::Test::test->create_gold;
+}
@@ -10,16 +10,17 @@
use strict;
use warnings;
-require 5.010_001;
+require 5.012;
-# use autodie;
+use autodie;
use System "sys:dsys: command, error";
my @opt = qw( perl modules
- zlib gd openssl nagios
+ postgres
+ zlib openssl
apache mod_perl fastcgi
- git subversion postgres
+ git
coverage all );
my $Usage =
@@ -31,31 +32,12 @@ my $Installation = shift || die $Usage;
my $Options = "@ARGV";
$Options = "dry" if $Options =~ /\bdry\b/;
$Options = "@opt" if $Options =~ /\ball\b/;
- pop @opt for 1 .. 4;
+ pop @opt for 1 .. 8;
$Options = "@opt" unless $Options;
my $Sw;
my $Perl;
-my $UBS = -d "/opt/bin";
-if ($UBS)
-{
- $ENV{PATH} = "/usr/bin:/usr/sbin:/bin:/sbin:/usr/ucb:" .
- "/usr/ccs/bin:/usr/ccs/lib:/usr/openwin/bin";
- $ENV{ORACLE_HOME} = `op chile_db oracle_home`;
- $ENV{ORACLE_HOME} ||= "/export/opt/p2orstree/10.1.0.4";
- $ENV{ORACLE_HOME} = "/app/ora/p2orstree/10.1.0.4"
- unless -e $ENV{ORACLE_HOME};
- $ENV{LD_LIBRARY_PATH} = "$ENV{ORACLE_HOME}/lib32:/usr/ucblib";
-}
-else
-{
- # $ENV{ORACLE_HOME} = "/usr/lib/oracle/xe/app/oracle/product/10.2.0/server";
- # die "ORACLE_HOME needs to be set!" unless exists $ENV{ORACLE_HOME};
- # die "ORACLE_HOME is invalid!" unless -d $ENV{ORACLE_HOME};
- # $ENV{LD_LIBRARY_PATH} = "$ENV{LD_LIBRARY_PATH}:$ENV{ORACLE_HOME}/lib";
-}
-
my $Top = `pwd`;
chomp $Top;
my $Build = "$Top/build";
@@ -85,7 +67,7 @@ sub building ($)
sub uncompress
{
- $_[0] =~ /2$/ ? "bzcat" : $UBS ? "gzcat" : "zcat"
+ $_[0] =~ /2$/ ? "bzcat" : "zcat"
}
sub build ($$$)
@@ -117,23 +99,15 @@ sub build ($$$)
print "built $module\n";
}
-sub feed ($$)
-{
- my ($command, $input) = @_;
- open my $c, "| $command" or die "Cannot run $command:$!\n";
- print $c $input;
- close $c or die "Cannot run $command:$!\n";
-}
-
sub main ()
{
dsys "rm -rf $Build";
- mkdir $Build, 0750 or die "Can't mkdir $Build: $!";
+ mkdir $Build, 0750;
$ENV{HOME} = $Sw;
- my $gmake = "/app/home/t136103/g/sw/bin/gmake";
- $gmake = "make" unless -e $gmake;
+ my $gmake = "make";
- if (building "perl")
+
+ if (building "perl" && (!-e "$Sw/bin/perl" || building "force"))
{
chdir $Build or die "Can't chdir $Build: $!";
dsys "rm -rf $Sw/*";
@@ -142,7 +116,7 @@ sub main ()
{
my $perl_dir = "/usr/local/pkg/bleadperl";
mkdir $perl_dir;
- chdir $perl_dir or die "Can't chdir $perl_dir: $!";
+ chdir $perl_dir;
dsys "rsync -avz --delete " .
"rsync://ftp.activestate.com/perl-current/ .";
}
@@ -150,7 +124,7 @@ sub main ()
{
my $perl_dir = "$Installation/tmp/maintperl";
dsys "mkdir -p $perl_dir";
- chdir $perl_dir or die "Can't chdir $perl_dir: $!";
+ chdir $perl_dir;
if (1)
{
dsys "rsync -avz --delete " .
@@ -178,8 +152,7 @@ sub main ()
my @opts =
(
- "-Dperladmin=" .
- ($UBS ? "'paul-za.johnson\@ubs.com'" : "'paul\@pjcj.net'"),
+ "-Dperladmin='paul\@pjcj.net'",
"-Dprefix=$Sw",
);
push @opts, "-Dusedevel" if $Blead;
@@ -190,14 +163,15 @@ sub main ()
"-Dldflags='-fprofile-arcs -ftest-coverage'",
"-Doptimize='-g -O0'",
) if building "Xcoverage";
+ push @opts, "-A ccflags=-fPIC";
dsys "sh ./Configure -des @opts";
dsys "make" . (building "Xcoverage" ? " perl.gcov" : "");
- sys "make test";
- dsys "make install";
+ dsys "HARNESS_OPTIONS=j$ENV{TEST_JOBS}:c make -j$ENV{TEST_JOBS} test_harness install";
+ # dsys "make install";
my ($version) = glob "${Perl}5.*";
- symlink $version, $Perl;
+ symlink $version, $Perl unless -e $Perl;
$Options =~ s/\bperl\b//;
}
@@ -208,9 +182,10 @@ sub main ()
print "<$restart [$^X] [$Perl]>\n";
exec $restart if $^X !~ /$Perl/;
+
if (building "zlib")
{
- my $zlib = "zlib-1.2.3";
+ my $zlib = "zlib-1.2.5";
build $zlib,
$Src_dir,
{
@@ -219,61 +194,19 @@ sub main ()
};
}
- if (building "gd")
- {
- my $jpeg = "jpegsrc.v6b";
- my $jpegdir = "jpeg-6b";
- build $jpeg,
- $Src_dir,
- {
- dir => sub { $jpegdir },
- config => sub { dsys "./configure --prefix=$Sw" },
- install => sub
- {
- dsys "make install install-lib install-headers";
- },
- };
-
- my $png = "libpng-1.2.34";
- build $png,
- $Src_dir,
- {
- config => sub
- {
- my $ext = $UBS ? "32sunu" : "linux";
- dsys "cp scripts/makefile.$ext Makefile";
- dsys "perl -pi -e 's|^(prefix=).*|\$1$Sw|' Makefile";
- dsys "make" .
- " ZLIBLIB=$Sw/lib" .
- " ZLIBINC=$Sw/include";
- }
- };
-
- my $gd = "gd-2.0.35";
- build $gd,
- $Src_dir,
- {
- config => sub
- {
- dsys "./configure" .
- " --prefix=$Sw" .
- " --with-jpeg=$Sw" .
- " --with-png=$Sw";
- }
- };
- }
if (building "openssl")
{
# my $openssl = "openssl-0.9.8g"; # Crypt::SSLeay fails
- my $openssl = "openssl-0.9.7" . ($UBS ? "g" : "j"); # Solaris fails
+ my $openssl = "openssl-0.9.7j";
# my $openssl = "openssl-0.9.8j";
build $openssl,
$Src_dir,
{ config => sub { dsys "./config --prefix=$Sw shared" } };
}
- $ENV{LD_PRELOAD} = "$Sw/lib/libssl.so" if -e "$Sw/lib/libssl.so" && !$UBS;
+ $ENV{LD_PRELOAD} = "$Sw/lib/libssl.so" if -e "$Sw/lib/libssl.so";
+
# my $apache = "apache_1.3.41";
my $apache = "httpd-2.2.11";
@@ -349,6 +282,7 @@ sub main ()
if building "mod_perl";
}
+
if (building "fastcgi" && -e "$Sw/bin/httpd")
{
my $fastcgi = "mod_fastcgi-2.4.6";
@@ -372,9 +306,10 @@ sub main ()
}
}
+
if (building "git")
{
- my $git = "git-1.6.3.3";
+ my $git = "git-1.6.3.3";
build $git,
$Src_dir,
@@ -385,126 +320,12 @@ sub main ()
test => sub { dsys "echo $gmake test" },
install => sub { dsys "$gmake install" },
}
- }
-
- if (building "subversion")
- {
- my $neon = "neon-0.25.5"; # subversion needs this version
- # build $neon,
- # $Src_dir,
- # {
- # config => sub
- # {
- # dsys "./configure" .
- # " --prefix=$Sw" .
- # ($UBS ? "" : " --enable-shared") .
- # " --with-ssl=openssl" .
- # " --with-libs=$Sw";
- # },
- # };
-
- my $swig = "swig-1.3.29"; # subversion needs a version after 1.3.23
- build $swig,
- $Src_dir,
- {
- config => sub
- {
- dsys "./configure" .
- " --prefix=$Sw" .
- " --with-perl5=$Perl"
- },
- make => sub { dsys "$gmake" },
- test => sub {},
- install => sub { dsys "$gmake install" },
- };
-
- die "Can't find swig" unless `which swig`;
-
- my $subversion = "subversion-1.4.5";
- build $subversion,
- $Src_dir,
- {
- config => sub
- {
- dsys "./configure" .
- " --prefix=$Sw" .
- " --without-berkeley-db" .
- ($UBS ? " --without-ssl --without-zlib"
- : " --with-ssl --with-zlib") .
- " --enable-shared" .
- " --with-apxs=$Sw/bin/apxs" .
- " --with-libs=$Sw" .
- " PERL=$Perl";
- },
- make => sub
- {
- dsys "make";
- dsys "make swig-pl";
- },
- test => sub
- {
- dsys "make check-swig-pl";
- },
- install => sub
- {
- dsys "make install";
- dsys "make install-swig-pl";
- },
- };
}
- if (building "nagios")
- {
- my $nagios = "nagios-3.0.6";
- build $nagios,
- $Src_dir,
- {
- config => sub
- {
- my $user = getpwuid($<);
- my $group = getgrgid($();
- {
- local ($^I, @ARGV) = (".bak", "cgi/status.c");
- while (<>)
- {
- s/(int max_grid_width=)8;/${1}135;/;
- s/(current_item)\+\+;/${1}+=strlen\(temp_servicestatus->description\)+1;/;
- print;
- }
- }
- sys "chdir common && ln -s ../base/snprintf.o .";
- dsys "./configure" .
- " --prefix=$Sw" .
- " --with-htmurl=/chile_monitor" .
- " --with-cgiurl=/chile_monitor/cgi-bin" .
- " --with-nagios-user=$user" .
- " --with-nagios-group=$group" .
- " --with-gd-inc=$Sw/include" .
- " --with-gd-lib=$Sw/lib";
- },
- make => sub
- {
- sys "make all install";
- },
- };
-
- my $plugins = "nagios-plugins-1.4.13";
- build $plugins,
- $Src_dir,
- {
- config => sub
- {
- dsys "CFLAGS=-lm ./configure" .
- " --prefix=$Sw" .
- " --with-cgiurl=/chile_monitor/cgi-bin"
- },
- test => sub {},
- };
- }
if (building "postgres")
{
- my $postgres = "postgresql-8.4.0";
+ my $postgres = "postgresql-8.4.4";
build $postgres,
$Src_dir,
{
@@ -514,12 +335,14 @@ sub main ()
" --prefix=$Sw" .
" --with-pgport=5433" .
" --without-readline" .
+ " --without-zlib" .
" --with-perl";
},
make => sub { dsys "$gmake" },
test => sub { dsys "$gmake check" },
install => sub { dsys "$gmake install-strip" },
- };
+ }
+ unless -e "$Sw/bin/pg_ctl" && !building "force";
}
@@ -527,486 +350,267 @@ sub main ()
{
my @modules =
qw(
- Bundle::CPAN
- Bundle::LWP
- CPAN::Mini
-
- LWP
- ExtUtils::ParseXS
- Module::Build
- Test::Pod
- Test::Pod::Coverage
- Archive::Tar
- Data::Page
- Date::Calc
- Apache::Compress
- Apache::Filter
- Apache::Session
- Apache::Test
- Data::UUID
- DateTime
- Class::Trigger
- DBIx::ContextualFetch
- DBIx::Class
DBIx::Class::InflateColumn::DateTime
- DBIx::ProcedureCall
- Image::Size
Template
- Number::Format
- Template::Plugin::Number::Format
- HTML::Lint
- JSON
- Test::JSON
- HTTP::Response::Encoding
- WWW::Mechanize
- Test::WWW::Mechanize
- PPI::HTML
- Perl::Tidy
- Devel::Cover
- Shell::Source
- B::Utils
- Log::Log4perl
- DBIx::Log4perl
- Net::Server
- XXNet::IRC
- File::Find::Rule
- Proc::ProcessTable
- Text::Template
- Data::Dump::Streamer
- Spreadsheet::ParseExcel
- Email::Send
- Text::Table
- Text::TabularDisplay
- C::Scan
- Cache::FastMmap
-
- XXCGI::Simple::Cookie
- XXData::Dump
- XXModule::Pluggable
-
- DBD:Pg
+ DBD::Pg
DBIx::Class::Schema::Loader::DBI::Pg
- MooseX::Declare
-
Catalyst
- Catalyst::Controller::FormBuilder
Catalyst::Devel
- Catalyst::Engine::Apache
- Catalyst::Engine::HTTP::POE
+ Catalyst::Engine::PSGI
Catalyst::Model::DBIC::Schema
Catalyst::Plugin::Authentication
- Catalyst::Plugin::Authentication::Store::DBIx::Class
Catalyst::Plugin::Authorization::Roles
Catalyst::Plugin::ConfigLoader
- Catalyst::Plugin::JSONRPC
- Catalyst::Plugin::Server::XMLRPC
Catalyst::Plugin::Session::State::Cookie
Catalyst::Plugin::Session::Store::FastMmap
Catalyst::Plugin::StackTrace
Catalyst::Plugin::Static::Simple
- Catalyst::Plugin::XMLRPC
Catalyst::View::JSON
Catalyst::View::TT
- FCGI
- FCGI::ProcManager
- SOAP::Lite
- Sort::Versions
- Alien::SeleniumRC
- Test::WWW::Selenium
- Test::WWW::Mechanize::Catalyst
- HTML::TagCloud
+ MooseX::Declare
- Test::Exception
- Test::Warn
+ Starman
+
+ Gitalist
- Date::Parse
-
- Net::SSLeay
- ); my @no = qw(
-
- DBIx::Class::Schema::Loader::DBI::Oracle
-
- XXBundle::Test XX_seems_to_want_to_reinstall_perl_itself
- Plagger
- XXBundle::BioPerl
- XXBio::Perl
- S/SE/SENDU/bioperl-1.5.2_102.tar.gz
- Tk
- Regexp::Common
- XXBundle::POE::All
- XXBundle::Email
- XXBundle::Phalanx
- XXBundle::HTML::Mason
- XXBundle::Slash
- XXBundle::RT
- XXBundle::Bricolage
- XXBundle::BricolagePlus
-
- XXPhalanx
+ Devel::Cover
+ Parallel::Iterator
+ Test::Pod::Coverage
+
+ ../..
+
+ Gedcom
+ Shell::Source
+
+ XX-Top-Level-Modules-With-Many-Dependencies
+ MojoMojo
+ Jifty
+ Dist::Zilla
+ Bot::BasicBot
+
+ XX-Modules-With-Many-Dependents
+ Exporter
+ Text::Tabs
Test::Harness
- Test::Reporter
- Test::Builder
- Test::Builder::Tester
- Sub::Uplevel
- Test::Exception
- Test::Tester
- Test::NoWarnings
- Test::Tester
Pod::Escapes
Pod::Simple
- Test::Pod
- YAML
- Cwd
- Archive::Tar
+ IO
+ Getopt::Long
+ Pod::Parser
+ ExtUtils::MakeMaker
+ Test::Simple
+ ExtUtils::Manifest
+ constant
+ Test
+ Data::Dumper
+ File::Temp
+ ExtUtils::Install
+ Text::ParseWords
+ ExtUtils::CBuilder
+ ExtUtils::ParseXS
Module::Build
- Devel::Symdump
- Pod::Coverage
- Test::Pod::Coverage
- Compress::Zlib
- IO::Zlib
- Archive::Zip
- Archive::Tar
- Storable
+ File::Path
+ XSLoader
+ MIME::Base64
+ Digest
Digest::MD5
+ Sub::Uplevel
URI
+ Test::Exception
HTML::Tagset
HTML::Parser
- LWP
- IPC::Run
- CPANPLUS
- DBI
- XXDBD::mysql
- GD
- MIME::Base64
- XXNet::SSLeay
- Net::LDAP
- XML::Parser
- Apache::ASP
- CGI
- Date::Manip
- DBD::Oracle
- XXDBD::Pg
- Digest::SHA1
- Digest::HMAC
- HTML::Tagset
- HTML::Template
- Net::Cmd
- Mail::Mailer
- MIME::Body
- Net::DNS
+ Compress::Raw::Zlib
+ Compress::Raw::Bzip2
+ Storable
+ base
+ List::MoreUtils
+ Params::Util
+ Task::Weaken
+ Sub::Install
+ Data::OptList
+ Sub::Exporter
+ Test::Tester
+ Test::NoWarnings
+ Attribute::Handlers
+ Class::Accessor
+ Algorithm::C3
+ Class::C3
+ Sub::Name
+ MRO::Compat
Time::HiRes
- Apache::DBI
- Apache::Session
- Apache::Test
- AppConfig
- App::Info
- XXAuthen::PAM
- Authen::SASL
- XXBerkeleyDB
- Bit::Vector
+ Params::Validate
+ Try::Tiny
+ Scope::Guard
+ Package::Stash
+ version
+ Tree::DAG_Node
+ Test::Warn
+ Devel::GlobalDestruction
+ Class::MOP
+ Moose
+ Class::Data::Inheritable
+ Test::Deep
Carp::Clan
- Chart::Bars
- Class::DBI
- Compress::Zlib::Perl
- Config::IniFiles
- Convert::ASN1
- Convert::TNEF
- Convert::UUlib
- CPAN
- Crypt::CBC
- Crypt::DES
- Crypt::SSLeay
- Data::Dumper
- Date::Calc
- DateTime
- XXDBD::DB2
- XXDBD::ODBC
- XXDBD::SQLite
- XXDBD::Sybase
- Device::SerialPort
- Digest::SHA
+ Module::Pluggable
+ Variable::Magic
+ B::Hooks::EndOfScope
+ Sub::Identify
+ namespace::clean
+ Time::Local
+ DBI
+ Text::Balanced
+ Class::Inspector
+ Test::Pod
Encode
- Event
- Excel::Template
- Expect
+ Path::Class
+ Digest::SHA1
+ FCGI
+ CGI
+ MooseX::Types
+ XML::NamespaceSupport
+ XML::SAX
+ Class::Singleton
+ Clone
+ DateTime::TimeZone
+ DateTime::Locale
+ YAML
+ DateTime
+ namespace::autoclean
+ IO::String
+ Algorithm::Diff
+ File::Slurp
+ Devel::StackTrace
+
+ XX-Modules-Which-Should-Not-Fail
+ IO
+ List::MoreUtils
+ Test::Harness
ExtUtils::MakeMaker
- File::Scan
- File::Spec
- File::Tail
+ File::Path
+ XML::Parser
+ Test::Simple
+ HTML::Tree
+ Storable
+ Net::IP
+ DB_File
+ XML::LibXML
+ Time::HiRes
+ Exporter
+ Pod::Escapes
+ ExtUtils::ParseXS
+ Module::Build
+ Pod::Parser
+ Data::Dumper
+ ExtUtils::Install
+ IO::Tty
+ XML::SAX
+ Class::ErrorHandler
+ URI
+ HTML::Template
+ Compress::Raw::Zlib
+ Net::DNS
+ Test::Pod::Coverage
+ XSLoader
+ version
+ URI::Fetch
+ Pod::Simple
+ constant
+ Test
File::Temp
- GD::Graph
- GD::Text
- Getopt::Long
- XXHTML::Mason XX_wants_to_install:mod_perl_1
- Image::Size
- IMAP::Admin
- Parse::RecDescent
- Inline
- IO
- Spiffy
- IO::All
- IO::Socket::SSL
- IO::String
- IO::Stringy
- XML::SAX2Perl
- Mail::Audit
- XXMail::ClamAV
- Mail::Sendmail
- Math::Pari
- MD5
- MIME::Lite
- MP3::Info
- Net::Daemon
- Net::FTP::Common
- Net::Ping
- Net::Server
- Net::SNMP
-
- XX_install_these_four_modules_in_order_before_Net::SSH::Perl
- XX_Net::SSH::Perl_requires_Crypt_DH
- XX_which_is_S_L_O_W_without_Math::BigInt::GMP
- Math::BigInt
- Math::BigRat
- bignum
- Math::BigInt::GMP
- XXNet::SSH::Perl
- XX_bah_the_whole_thing_is_broken___
-
- Net::Telnet
- OLE::Storage_Lite
+ XXTemplate::Toolkit
+ Cache::Cache
+ Feed::Find
+ HTML::Tagset
+ ExtUtils::PkgConfig
+ Devel::GlobalDestruction
+ PadWalker
+ Sub::Name
+ Encode
+ Test::Base
+ Class::DBI::Plugin::Type
+ Sub::Identify
+ Sub::Uplevel
Params::Validate
- XXImage::Magick
- RPC::PlServer
- Pod::Parser
POE
- XXSNMP
- SOAP::Lite
- Spreadsheet::ParseExcel
- Spreadsheet::WriteExcel
- Spreadsheet::WriteExcelXML
- Storable
- Template
- Term::ReadKey
- Term::ReadLine::Perl
- Text::Iconv
- Date::Parse
- Time::Timezone
- Unicode::String
- Unix::Syslog
- XXVerilog::Parser
+ Class::Singleton
+ Proc::ProcessTable
+ Compress::Raw::Bzip2
+ Class::MOP
+ HTTP::Server::Simple
+ Sub::Exporter
+ Fuse
+ File::HomeDir
+ Bot::BasicBot
+ XXURI::Find::Simple
+ base
+ XXGD
WWW::Mechanize
- XML::DOM
- XML::Generator
- XML::LibXML
- XML::NamespaceSupport
- XML::SAX
+ Test::Most
+ Sys::Syslog
+ File::Slurp
+ Tree::DAG_Node
+ FCGI
+ Params::Util
+ Devel::Peek
+ DateTime::Format::Mail
+ Spiffy
+ HTML::TableExtract
+ DBD::SQLite
+ Class::Accessor::Chained
+ DBIx::ContextualFetch
+ Test::Tester
+ Variable::Magic
+ AppConfig
+ Class::Accessor
+ Want
XML::Simple
- XML::Writer
- );
- # push @modules, "Apache::Request" if $apache !~ /apache/;
- push @modules, "Crypt::SSLeay" if -e "$Sw/bin/openssl";
- push @modules, "DBD::Oracle",
- "DBIx::Class::Schema::Loader::DBI::Oracle",
- if exists $ENV{ORACLE_HOME} && -d $ENV{ORACLE_HOME};
- # push @modules, "MQSeries" if $UBS;
- push @modules, "H/HB/HBIERSMA/MQSeries-1.28-b.tar.gz" if $UBS;
- push @modules, "SVN::Simple::Edit", "SVN::Mirror", "FreezeThaw", "SVK",
- "Exception::Class", "SVN::Web"
- if -e "$Sw/bin/svn";
-
- for (qw( XX/mnt/wesley/pjcj/g/perl/svk/dc
- XX/home/pjcj/g/perl/dc
- XX/bcy/pidjjq/dc
- /home/pjcj/g/work/Devel-Cover
- ))
- {
- push @modules, $_ if -e;
- }
-
- my $config =
- {
+ IO::All
+ Number::Format
+ Term::ReadKey
+ DBI
+ Test::Exception
+ );
- LWP => { test => sub {} },
- "Apache::Compress" => { test => sub {} },
- "Apache::Filter" => { test => sub {} },
- "Apache::Request" => { test => sub {} },
- "Apache::TEST" => { test => sub {} },
- "Data::Dump::Streamer" =>
- { config => sub { dsys "$Perl Makefile.PL DDS" } },
- "Crypt::SSLeay" =>
- {
- config => sub
- {
- # dsys qq($Perl -pi -e 's|(my \\\@POSSIBLE_SSL_DIRS = ).*|).
- # qq(\$1"$Sw";|' Makefile.PL);
- dsys "$Perl Makefile.PL --lib=$Sw/include"
- }
- },
- "SVN::Web" =>
- { config => sub { dsys "yes n | $Perl Makefile.PL" } },
- $UBS ?
- (
- "DBD::Oracle" =>
- { config => sub { dsys "$Perl Makefile.PL -m $ENV{ORACLE_HOME}".
- "/rdbms/lib/ins_rdbms.mk" } },
- ) : ()
- };
-
- my $cpandir = "http://cpan.wanadoo.nl/";
- for my $d (qw(
- /app/home/t136103/g/build/src/cpan
- /home/pidjjq/g/src/cpan
- /usr/local/pkg/cpan
- /home/pjcj/g/download/cpan ))
- {
- $cpandir = "file://$d/" if -d $d;
- }
- my $tar = $UBS ? "/app/home/t136103/g/sw/bin/gnutar" : "/bin/tar";
- my $f = "$Sw/.cpan";
- -d $f or mkdir $f, 0750 or die "Can't mkdir $f: $!";
- $f .= "/CPAN";
- -d $f or mkdir $f, 0750 or die "Can't mkdir $f: $!";
- $f .= "/MyConfig.pm";
- open my $fh, ">", $f or die "Can't open $f: $!";
- print $fh <<EOF;
-\$CPAN::Config = {
- 'build_cache' => q[100000],
- 'build_dir' => q[$Sw/.cpan/build],
- 'cache_metadata' => q[1],
- 'cpan_home' => q[$Sw/.cpan],
- 'dontload_hash' => { },
- 'ftp' => q[/usr/bin/ftp],
- 'ftp_proxy' => q[],
- 'getcwd' => q[cwd],
- 'gpg' => q[/usr/bin/gpg],
- 'gzip' => q[/bin/gzip],
- 'histfile' => q[$Sw/.cpan/histfile],
- 'histsize' => q[100],
- 'http_proxy' => q[],
- 'inactivity_timeout' => q[0],
- 'index_expire' => q[1],
- 'inhibit_startup_message' => q[0],
- 'keep_source_where' => q[$Sw/.cpan_sources],
- 'lynx' => q[/usr/bin/lynx],
- 'make' => q[/usr/bin/make],
- 'make_arg' => q[],
- 'make_install_arg' => q[],
- 'makepl_arg' => q[],
- 'ncftp' => q[],
- 'ncftpget' => q[],
- 'no_proxy' => q[],
- 'pager' => q[less],
- 'prerequisites_policy' => q[follow],
- 'scan_cache' => q[atstart],
- 'shell' => q[/bin/zsh],
- 'tar' => q[$tar],
- 'term_is_latin' => q[1],
- 'unzip' => q[/usr/bin/unzip],
- 'urllist' => [q[$cpandir]],
- 'wget' => q[/usr/bin/wget],
- 'auto_commit' => q[1],
- 'mbuildpl_arg' => q[],
- 'mbuild_arg' => q[],
- 'mbuild_install_build_command' => q[./Build],
- 'mbuild_install_arg' => q[],
-};
-print STDERR "Reading MyConfig!\\n";
-1;
-EOF
- close $fh or die "Can't close $f: $!";
-
- $ENV{APXS} = "$Sw/bin/apxs";
-
- eval "use CPAN";
-
- # dsys "echo upgrade | $Sw/bin/cpan";
- CPAN::Shell->upgrade("/./");
- # my $inst = sub { dsys "$Sw/bin/cpan install @_" };
- my $inst = sub { CPAN::Shell->install(@_) or
- CPAN::Shell->force("install", @_) };
-
- for my $m (@modules)
+ my $cpanm = "$Sw/bin/cpanm";
+ dsys((-e $cpanm ? $cpanm : "wget -O - http://cpanmin.us | $Perl -") .
+ " --self-upgrade\n");
+ for my $mod (@modules)
{
- if ($m =~ /^\//)
- {
- print "Installing $m\n";
- my $c =
- {
- %{$config->{$m} || {}},
- unpack => sub {},
- dir => sub { $m },
- test => sub {},
- };
- build $m, $m, $c;
- print "installed $m via Makefle.PL\n";
- }
- else
- {
- next if $m =~ /^XX/; # don't want these right now
- print "Installing $m\n";
- # for my $mod (CPAN::Shell->expand("Module", "/./")) { print $mod->id, "\n" }
- if (my $mod = CPAN::Shell->expandany($m))
- {
- # my $mod = CPAN::Shell->expand("Module", "/$m/") or die "Can't expand [$m]";
- print $mod->as_string;
- next if $mod->uptodate;
- # printf "Module %s is installed as %s and will be updated to %s from CPAN\n",
- # $mod->id, $mod->inst_version || "-", $mod->cpan_version;
-
- if ($config->{$m})
- {
- print "Installing $m version ", $mod->cpan_version, "\n";
- my $b = $mod->cpan_file;
- $b =~ s|.*/||;
- $b =~ s|\.tar.gz||;
- $b = "$Sw/.cpan/build/$b";
- sys "rm -rf $b-*";
- $mod->get;
- ($b) = glob "$b-*" unless -d $b;
- die "Can't find build dir $b" unless -d $b;
- print "Building in $b\n";
- my $c =
- {
- %{$config->{$m}},
- unpack => sub {},
- dir => sub { $b },
- $Blead ?
- (
- make => sub { sys "make" },
- install => sub { sys "make install" },
- ) : ()
- };
- build $m, $b, $c;
- }
- else
- {
- $inst->($m);
- }
- }
- else
- {
- warn "Can't expand [$m]";
- $inst->($m);
- }
- print "installed $m via CPAN\n";
- }
+ next if $mod =~ /^XX/;
+ dsys "$cpanm -v --force --mirror http://cpan.wanadoo.nl/ $mod\n"
+ if sys "$cpanm $mod\n";
}
}
+
if (building "coverage")
{
+ my $dir = "$Sw/.cpanm/work";
+
+ my $mods = "$Sw/modules";
+ mkdir $mods, 0750 unless -d $mods;
+ for my $d (grep -d, <$dir/*/*>)
+ {
+ print "Linking $d\n";
+ my ($e) = $d =~ m|/([^/]+)$| or die "Can't find module name";
+ my $new = "$mods/$e";
+ unlink $new if -e $new;
+ symlink $d => $new;
+ }
+
my $c;
- $c .= "/usr/local/pkg/base/sw/bin/perl $Sw/bin/" if $Blead;
- $c .= "cpancover -directory $Sw/.cpan/build -outputdir $Sw/cpancover ";
+ $c .= "perl5.12.2 $Sw/bin/" if $Blead;
+ $c .= "cpancover -directory $mods -outputdir $Sw/cpancover ";
$c .= "-outputfile index.html -report ";
$c .= $Blead ? "html" : "html_basic";
# $c .= " -force";
$c .= " -redo_html";
- dsys $c;
+ dsys "$c\n";
}
+
if (building "postgres" || building "dry")
{
my $pg = "$Installation/pgsql";
@@ -1019,15 +623,15 @@ Now run the following commands as root:
rm -rf $pg
mkdir -p $data
-chown -R postgres.postgres $pg
-su - postgres
+# chown -R postgres.postgres $pg
+# su - postgres
$Sw/bin/initdb -D $data
$Sw/bin/pg_ctl start -l $log -D $data
sleep 10
-$Sw/bin/createuser -P -e -s factr
-$Sw/bin/createdb -e -O factr factr
+$Sw/bin/createuser -P -e -s tsg
+$Sw/bin/createdb -e -O tsg tsg
-# $Sw/bin/psql factr
+# $Sw/bin/psql tsg
and stop the db with:
@@ -1044,6 +648,7 @@ $Perl = "$Sw/bin/perl";
$ENV{PATH} = "$Sw/bin:$ENV{PATH}";
$ENV{LD_LIBRARY_PATH} = "$Sw/lib:$ENV{LD_LIBRARY_PATH}";
$ENV{AUTOMATED_TESTING} = 1;
+$ENV{TEST_JOBS} = 7;
print "sw directory is $Sw\n";
print "perl is $Perl\n";
@@ -1057,18 +662,4 @@ main
__END__
-# cd /opt/bcy
-# chown -R t136103:ubsadmin sw
-$ cd $root/install
-$ perl ./buildperl ~/g/src perl-5.10.0 /opt/bcy
-# rm -rf sw/.cpan* sw/.subversion sw/bin/perl5.10.0
-# chown -R ubcy1001:gbcy1001 sw
-# chmod -R 755 sw
-$ cd /app/sw/wss/current
-$ mv base/sw sw.old
-$ cp -a /opt/bcy/sw base
-
-
-
-$ perl ./buildperl ~/g/perl/src blead /usr/local/pkg/factr perl modules apache mod_perl zlib openssl subversion
-$ perl ./buildperl ~/g/perl/src perl-5.8.8 /usr/local/pkg/factr-5.8.8 perl modules apache zlib openssl subversion
+$ perl5.12.2 ./buildperl ~/g/perl/src perl-5.12.2 /usr/local/pkg/tsg perl modules postgres
@@ -0,0 +1,37 @@
+#!/usr/bin/perl
+
+# Copyright 2001-2010, Paul Johnson (pjcj@cpan.org)
+
+# This software is free. It is licensed under the same terms as Perl itself.
+
+# The latest version of this software should be available from my homepage:
+# http://www.pjcj.net
+
+use strict;
+use warnings;
+
+my $Command =
+{
+ strip_criterion => sub
+ {
+ my ($command, $criterion, $file) = @_;
+ my $t;
+ local ($^I, @ARGV) = (".bak", $file);
+ while (<>)
+ {
+ $t = index($_, "$criterion code") -3 if !defined $t || $t < 0;
+ substr $_, $t, 7, ""
+ if /^line err stmt/ .. /^--------/ and $t > -1 and length > $t;
+ print;
+ }
+ },
+};
+
+sub main
+{
+ my ($command) = @ARGV;
+ die "No such command: $command" unless $Command->{$command};
+ $Command->{$command}->(@ARGV)
+}
+
+main
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -w
+use strict;
+use Digest::MD5;
+
+process_file($_) for @ARGV;
+
+sub process_file {
+ my $file = shift;
+ open my $fh, $file or die $!;
+ while (<$fh>) {
+ my ($count, $crit, $reason) = m/# uncoverable:\s+(\d+)\s+(\w+)\s+(.*$)/ or next;
+ my $md5 = Digest::MD5->new->add($_)->hexdigest;
+ $crit =~ s/s$//;
+ for (0..$count-1) {
+ print "$file $crit $md5 $_ 0 $reason\n";
+ }
+ }
+}
@@ -0,0 +1,17 @@
+1,999bd
+e Makefile.PL
+e MANIFEST
+e docs/CHANGES
+e docs/TODO
+e docs/BUGS
+e lib/Devel/Cover.pm
+e lib/Devel/Cover/DB.pm
+e Cover.xs
+e cover
+e cpancover
+e lib/Devel/Cover/Test.pm
+e lib/Devel/Cover/Report/Text.pm
+e lib/Devel/Cover/Report/Html_minimal.pm
+e lib/Devel/Cover/Report/Html_basic.pm
+e #1
+Tlist